PGROUTING  3.2
pgr_messages.h
Go to the documentation of this file.
1 /*PGR-GNU*****************************************************************
2 
3 FILE: pgr_messages.h
4 
5 Copyright (c) 2015 pgRouting developers
6 Mail: project@pgrouting.org
7 
8 ------
9 
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
14 
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19 
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 
24  ********************************************************************PGR-GNU*/
25 
28 #ifndef INCLUDE_CPP_COMMON_PGR_MESSAGES_H_
29 #define INCLUDE_CPP_COMMON_PGR_MESSAGES_H_
30 #pragma once
31 
32 
33 
34 #include <string>
35 #include <sstream>
36 
37 namespace pgrouting {
38 
39 class Pgr_messages {
40  public:
41  Pgr_messages() = default;
42  Pgr_messages(const Pgr_messages&) = delete;
43  Pgr_messages& operator=(const Pgr_messages&) = delete;
44 
50  std::string get_log() const;
51 
57  std::string get_notice() const;
58 
63  bool has_error() const;
64 
70  std::string get_error() const;
71 
77  void clear();
78 
79  public:
81  mutable std::ostringstream log;
83  mutable std::ostringstream notice;
85  mutable std::ostringstream error;
86 };
87 
88 
89 #if defined(__MINGW32__) || defined(_MSC_VER)
90 #define ENTERING(x)
91 #define EXITING(x)
92 #else
93 #define ENTERING(x) x.log << "\n--> " << __PRETTY_FUNCTION__ << "\n"
94 #define EXITING(x) x.log << "\n<-- " << __PRETTY_FUNCTION__ << "\n"
95 #endif
96 
97 
98 
99 
100 } // namespace pgrouting
101 
102 #endif // INCLUDE_CPP_COMMON_PGR_MESSAGES_H_
pgrouting::Pgr_messages
Definition: pgr_messages.h:39
pgrouting::Pgr_messages::error
std::ostringstream error
Stores the error information.
Definition: pgr_messages.h:85
pgrouting::Pgr_messages::log
std::ostringstream log
Stores the hint information.
Definition: pgr_messages.h:81
pgrouting::Pgr_messages::get_error
std::string get_error() const
get_error
Definition: pgr_messages.cpp:53
pgrouting::Pgr_messages::get_notice
std::string get_notice() const
get_notice
Definition: pgr_messages.cpp:42
pgrouting::Pgr_messages::get_log
std::string get_log() const
get_log
Definition: pgr_messages.cpp:36
pgrouting::Pgr_messages::operator=
Pgr_messages & operator=(const Pgr_messages &)=delete
pgrouting::Pgr_messages::clear
void clear()
clear
Definition: pgr_messages.cpp:59
pgrouting::Pgr_messages::has_error
bool has_error() const
get_error
Definition: pgr_messages.cpp:48
pgrouting::Pgr_messages::Pgr_messages
Pgr_messages()=default
pgrouting::Pgr_messages::notice
std::ostringstream notice
Stores the notice information.
Definition: pgr_messages.h:83
pgrouting
Book keeping class for swapping orders between vehicles.
Definition: pgr_alphaShape.cpp:56