MINT2
|
#include <MessageService.h>
Public Types | |
enum | ErrorType { WELCOME, ERROR, INFO, VERBOSE, GOODBYE } |
Define the possible error types. More... | |
typedef std::basic_ostream< char, std::char_traits< char > > | CoutType |
typedef CoutType &(* | StandardEndLine) (CoutType &) |
Public Member Functions | |
void | printErrorCount () |
template<class T > | |
MessageSerivce & | operator<< (const T &v) |
MessageSerivce & | operator<< (StandardEndLine manip) |
~MessageSerivce () | |
Static Public Member Functions | |
static MessageSerivce & | getMessageService (ErrorType errorType) |
static MessageSerivce & | getMessageService () |
Public Attributes | |
std::ostream & | _stream |
the output stream - by default this is std:cout More... | |
std::map< ErrorType, bool > | _outputOptions |
std::map< ErrorType, TString > | _outputHeaders |
bool | _endlCalled |
bool | _printOrNot |
ErrorType | _errorType |
long int | _errorCount |
Private Member Functions | |
MessageSerivce () | |
Static Private Attributes | |
static MessageSerivce * | s_messageService = 0 |
static variable that holds the singleton object More... | |
HyperPlot, Author: Sam Harnew, sam.h , Date: Dec 2015 arne w@gma il.c om
This is used to print all of the output from HyperPlot to a chosen output stream (by default std::cout). Access to this class is done through the precompiler definitions.
WELCOME_LOG - A welcome message in the constructor of each class ERROR_LOG - Use to print error messages to the screen INFO_LOG - Use to print useful information to the screen VERBOSE_LOG - Use for verbose information GOODBYE_LOG - A goodbye message in the destructor of each class
ERROR_COUNT - Print out how many error messages have been shown. This is useful to call at the end of the main function
Definition at line 33 of file MessageService.h.
typedef std::basic_ostream<char, std::char_traits<char> > MessageSerivce::CoutType |
this is the type of std::cout
Definition at line 131 of file MessageService.h.
this is the function signature of std::endl
Definition at line 135 of file MessageService.h.
Define the possible error types.
Enumerator | |
---|---|
WELCOME | |
ERROR | |
INFO | |
VERBOSE | |
GOODBYE |
Definition at line 45 of file MessageService.h.
|
private |
constuctor
Definition at line 55 of file MessageService.cpp.
MessageSerivce::~MessageSerivce | ( | ) |
destuctor
Definition at line 88 of file MessageService.cpp.
|
static |
Static function to retrive the MessageSerivce singleton. At the same time, also change the state of the MessageSerivce.
Definition at line 8 of file MessageService.cpp.
|
static |
Static function to retrive the MessageSerivce singleton without altering its message state
Definition at line 40 of file MessageService.cpp.
|
inline |
This makes is possible the do messageSerivce <<
Definition at line 83 of file MessageService.h.
|
inline |
define an operator<< to take in std::endl
Definition at line 139 of file MessageService.h.
void MessageSerivce::printErrorCount | ( | ) |
print how many errors messages have been sent to the output stream
Definition at line 77 of file MessageService.cpp.
bool MessageSerivce::_endlCalled |
bool was the last command sent to the steam a std::cout ?
Definition at line 61 of file MessageService.h.
long int MessageSerivce::_errorCount |
Count the number of errors that happened.
Definition at line 74 of file MessageService.h.
ErrorType MessageSerivce::_errorType |
The current message type of the MessageSerivce
Definition at line 70 of file MessageService.h.
std::map<ErrorType, TString> MessageSerivce::_outputHeaders |
this is the string that proceeds each of the message types
Definition at line 57 of file MessageService.h.
std::map<ErrorType, bool> MessageSerivce::_outputOptions |
this map decides what message types should be printed to the output stream (verbose, welcome and goodbye are off by default)
Definition at line 53 of file MessageService.h.
bool MessageSerivce::_printOrNot |
For the current message type, should I be printing to the stream (means you don't have to use the map many times in a row i.e. faster)
Definition at line 66 of file MessageService.h.
std::ostream& MessageSerivce::_stream |
the output stream - by default this is std:cout
Definition at line 48 of file MessageService.h.
|
staticprivate |
static variable that holds the singleton object
Definition at line 38 of file MessageService.h.