#include <MessageInterface.hpp>
Public Types | |
enum | priority_levels { DEBUG_ONLY, LESS_IMPORTANT, IMPORTANT } |
Public Member Functions | |
virtual void | operator() (const std::string &message, const int priority_level, int intend=0)=0 |
virtual void | operator() (int intend)=0 |
Static Public Attributes | |
static MessageInterface & | out |
This class defines the imaging2 log message interface. The user can pass log messages to the static member out and associate an intendation level and a priority with them. The implementation of MessageInterface is responsible for displaying them accordingly.
Here is an example on how MessageInterface can be used. Note that for this function to work properly an implementation of MessageInterface has to be included in the final application:
#include <core/MessageInterface.hpp> using imaging; void some_function() { MessageInterface::out("Enter some function.", MessageInterface::IMPORTANT); MessageInterface::out("Process data.", MessageInterface::LESS_IMPORTANT, +1); MessageInterface::out("Data seems okay.", MessageInterface::DEBUG_ONLY, +1); MessageInterface::out("Exit some function.", MessageInterface::IMPORTANT); }
virtual void imaging::MessageInterface::operator() | ( | const std::string & | message, | |
const int | priority_level, | |||
int | intend = 0 | |||
) | [pure virtual] |
Prints message. The priority and the level of intendation relative to the global intendation are determined by priority_level and intend. The specified intendentation is valid for this message only does not change the global intendation.
Implemented in imaging::Cmessage.
virtual void imaging::MessageInterface::operator() | ( | int | intend | ) | [pure virtual] |
Changes the global intendentation by intend.
Implemented in imaging::Cmessage.
MessageInterface & imaging::MessageInterface::out [static] |
Global log message output object.
Reimplemented in imaging::Cmessage.
Referenced by imaging::SteepestDescent::minimize(), imaging::NlCg::minimize(), imaging::Lbfgs::minimize(), imaging::CovarianceMatrixAdaptation::minimize(), imaging::XmlWriter::write_file(), and imaging::XmlReader::XmlReader().