vrpRouting  0.3
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
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 
30 #ifndef INCLUDE_CPP_COMMON_PGR_MESSAGES_H_
31 #define INCLUDE_CPP_COMMON_PGR_MESSAGES_H_
32 #pragma once
33 
34 
35 
36 #include <string>
37 #include <sstream>
38 
39 namespace vrprouting {
40 
41 
52 class Pgr_messages {
53  public:
54  Pgr_messages() = default;
56  Pgr_messages& operator=(const Pgr_messages&) {return *this;}
57 
63  std::string get_log() const;
64 
70  std::string get_notice() const;
71 
76  bool has_error() const;
77 
83  std::string get_error() const;
84 
86  void clear();
87 
88 
89  public:
91  mutable std::ostringstream log;
93  mutable std::ostringstream notice;
95  mutable std::ostringstream error;
96 };
97 
98 
99 
100 #if defined(__MINGW32__) || defined(_MSC_VER)
101 #define ENTERING(x)
102 #define EXITING(x)
103 #else
104 #define ENTERING(x) x.log << "\n--> " << __PRETTY_FUNCTION__ << "\n"
105 #define EXITING(x) x.log << "\n<-- " << __PRETTY_FUNCTION__ << "\n"
106 #endif
107 
108 
109 
110 } // namespace vrprouting
111 
112 #endif // INCLUDE_CPP_COMMON_PGR_MESSAGES_H_
vrprouting::Pgr_messages::log
std::ostringstream log
Stores the hint information.
Definition: pgr_messages.h:91
vrprouting::Pgr_messages::has_error
bool has_error() const
gets the contents of notice message
Definition: pgr_messages.cpp:48
vrprouting::Pgr_messages::error
std::ostringstream error
Stores the error information.
Definition: pgr_messages.h:95
vrprouting::Pgr_messages::get_notice
std::string get_notice() const
gets the contents of notice message
Definition: pgr_messages.cpp:42
vrprouting::Pgr_messages::get_log
std::string get_log() const
gets the contents of log message
Definition: pgr_messages.cpp:36
vrprouting::Pgr_messages::Pgr_messages
Pgr_messages(const Pgr_messages &)
Definition: pgr_messages.h:55
vrprouting::Pgr_messages::get_error
std::string get_error() const
gets the contents of error message
Definition: pgr_messages.cpp:53
vrprouting::Pgr_messages::operator=
Pgr_messages & operator=(const Pgr_messages &)
Definition: pgr_messages.h:56
vrprouting::Pgr_messages::clear
void clear()
Clears all the messages.
Definition: pgr_messages.cpp:59
vrprouting::Pgr_messages
Messages Handling.
Definition: pgr_messages.h:52
vrprouting::Pgr_messages::Pgr_messages
Pgr_messages()=default
vrprouting::Pgr_messages::notice
std::ostringstream notice
Stores the notice information.
Definition: pgr_messages.h:93
vrprouting
Definition: base_matrix.cpp:46