vrpRouting  0.3
vrprouting::Pgr_messages Class Reference

Messages Handling. More...

#include "pgr_messages.h"

Inheritance diagram for vrprouting::Pgr_messages:
Collaboration diagram for vrprouting::Pgr_messages:

Public Member Functions

 Pgr_messages ()=default
 
 Pgr_messages (const Pgr_messages &)
 
void clear ()
 Clears all the messages. More...
 
std::string get_error () const
 gets the contents of error message More...
 
std::string get_log () const
 gets the contents of log message More...
 
std::string get_notice () const
 gets the contents of notice message More...
 
bool has_error () const
 gets the contents of notice message More...
 
Pgr_messagesoperator= (const Pgr_messages &)
 

Public Attributes

std::ostringstream error
 Stores the error information. More...
 
std::ostringstream log
 Stores the hint information. More...
 
std::ostringstream notice
 Stores the notice information. More...
 

Detailed Description

Messages Handling.

A common structure to be used on the C++ code that stores messages intended for PostgreSQL

Messages currently handled: log notice error

Definition at line 52 of file pgr_messages.h.

Constructor & Destructor Documentation

◆ Pgr_messages() [1/2]

vrprouting::Pgr_messages::Pgr_messages ( )
default

◆ Pgr_messages() [2/2]

vrprouting::Pgr_messages::Pgr_messages ( const Pgr_messages )
inline

Definition at line 55 of file pgr_messages.h.

55 {}

Member Function Documentation

◆ clear()

void vrprouting::Pgr_messages::clear ( )

Clears all the messages.

Definition at line 59 of file pgr_messages.cpp.

59  {
60  log.str("");
61  log.clear();
62 
63  notice.str("");
64  notice.clear();
65 
66  error.str("");
67  error.clear();
68 }

References error, log, and notice.

Referenced by do_compatibleVehicles(), do_pgr_pickDeliver(), and do_pickDeliver().

◆ get_error()

std::string vrprouting::Pgr_messages::get_error ( ) const

gets the contents of error message

Returns
the current contents of error

Definition at line 53 of file pgr_messages.cpp.

53  {
54  auto str = error.str();
55  return str;
56 }

References error.

Referenced by vrprouting::problem::Fleet::add_vehicle(), do_compatibleVehicles(), do_pgr_pickDeliver(), do_pgr_pickDeliverEuclidean(), do_pickDeliver(), vrprouting::problem::Fleet::is_fleet_ok(), anonymous_namespace{optimize_driver.cpp}::one_processing(), and vrprouting::problem::PickDeliver::PickDeliver().

◆ get_log()

std::string vrprouting::Pgr_messages::get_log ( ) const

gets the contents of log message

Returns
the current contents of log

Definition at line 36 of file pgr_messages.cpp.

36  {
37  auto str = log.str();
38  return str;
39 }

References log.

Referenced by do_compatibleVehicles(), do_pgr_pickDeliver(), do_pgr_pickDeliverEuclidean(), do_pickDeliver(), vrprouting::problem::Fleet::get_unused_trucks(), vrprouting::problem::Fleet::invariant(), and anonymous_namespace{optimize_driver.cpp}::one_processing().

◆ get_notice()

std::string vrprouting::Pgr_messages::get_notice ( ) const

gets the contents of notice message

Returns
the current contents of notice

Definition at line 42 of file pgr_messages.cpp.

42  {
43  auto str = notice.str();
44  return str;
45 }

References notice.

◆ has_error()

bool vrprouting::Pgr_messages::has_error ( ) const

gets the contents of notice message

Returns
true when error message is not empty

Definition at line 48 of file pgr_messages.cpp.

48  {
49  return !error.str().empty();
50 }

References error.

◆ operator=()

Pgr_messages& vrprouting::Pgr_messages::operator= ( const Pgr_messages )
inline

Definition at line 56 of file pgr_messages.h.

56 {return *this;}

Member Data Documentation

◆ error

std::ostringstream vrprouting::Pgr_messages::error
mutable

◆ log

◆ notice

std::ostringstream vrprouting::Pgr_messages::notice
mutable

Stores the notice information.

Definition at line 93 of file pgr_messages.h.

Referenced by clear(), and get_notice().


The documentation for this class was generated from the following files:
vrprouting::Pgr_messages::log
std::ostringstream log
Stores the hint information.
Definition: pgr_messages.h:91
vrprouting::Pgr_messages::error
std::ostringstream error
Stores the error information.
Definition: pgr_messages.h:95
vrprouting::Pgr_messages::notice
std::ostringstream notice
Stores the notice information.
Definition: pgr_messages.h:93