![]() |
The Gaudi Framework
v30r3 (a5ef0a68)
|
#include <GaudiKernel/Message.h>

Public Member Functions | |
| Message () | |
| Default constructor. More... | |
| Message (const char *src, int type, const char *msg) | |
| Constructor. More... | |
| Message (std::string src, int type, std::string msg) | |
| Constructor. More... | |
| ~Message ()=default | |
| Default destructor. More... | |
| const std::string & | getMessage () const |
| Get the message string. More... | |
| void | setMessage (std::string msg) |
| Set the message string. More... | |
| int | getType () const |
| Get the message type. More... | |
| void | setType (int msg_type) |
| Set the message type. More... | |
| const std::string & | getSource () const |
| Get the message source. More... | |
| void | setSource (std::string src) |
| Set the message source. More... | |
| const std::string & | getFormat () const |
| Get the format string. More... | |
| void | setFormat (std::string msg) const |
| Set the format string. More... | |
| const std::string & | getTimeFormat () const |
| Get the time format string. More... | |
| void | setTimeFormat (std::string timeFormat) const |
| Set the time format string. More... | |
| bool | operator< (const Message &test) |
| Needed to build maps. More... | |
Static Public Member Functions | |
| static const std::string | getDefaultFormat () |
| Get the default format string. More... | |
| static const std::string | getDefaultTimeFormat () |
| Get the default time format string. More... | |
Private Member Functions | |
| void | invalidFormat () const |
| Called when an invalid format string is encountered. More... | |
| void | makeFormattedMsg (const std::string &format) const |
| Format the message. More... | |
| void | decodeFormat (const std::string &format) const |
| Decode format. More... | |
| void | sizeField (const std::string &text) const |
| Truncate or pad the output string to the field width as necessary. More... | |
| void | setWidth (const std::string &formatArg) const |
| Set the width of a stream. More... | |
Private Attributes | |
| std::string | m_message |
| The message. More... | |
| std::string | m_source = "UNKNOWN" |
| The source. More... | |
| std::string | m_format = DEFAULT_FORMAT |
| The format string. More... | |
| std::string | m_time_format = DEFAULT_TIME_FORMAT |
| Time format string. More... | |
| int | m_type = 0 |
| The type. More... | |
| std::string | m_formatted_msg |
| Formatted message. More... | |
| char | m_fill = ' ' |
| The current fill character. More... | |
| int | m_width = 0 |
| The current field width. More... | |
| bool | m_left = true |
| Justification. More... | |
| size_t | m_ecSlot |
| long int | m_ecEvt |
| pthread_t | m_ecThrd |
Static Private Attributes | |
| static const char | FORMAT_PREFIX = '%' |
| Formatting string characters. More... | |
| static const char | JUSTIFY_LEFT = 'L' |
| The character used to indicate start of left text justification. More... | |
| static const char | JUSTIFY_RIGHT = 'R' |
| The character used to indicate start of right text justification. More... | |
| static const char | MESSAGE = 'M' |
| The character used to indicate that the message should be printed. More... | |
| static const char | TYPE = 'T' |
| The character used to indicate that the message type should be printed. More... | |
| static const char | TIME = 't' |
| The character used to indicate that the message timestamp should be printed. More... | |
| static const char | UTIME = 'u' |
| The character used to indicate that the message timestamp should be printed in UTC time. More... | |
| static const char | SOURCE = 'S' |
| The character used to indicate that the message source should be printed. More... | |
| static const char | FILL = 'F' |
| The character used to indicate that the previous character is to be used for padding out fields if the text is not long enough. More... | |
| static const char | WIDTH = 'W' |
| The character used to indicate that the previous decimal characters should be taken as the field width. More... | |
| static constexpr const char * | DEFAULT_FORMAT = "% F%18W%S%7W%R%T %0W%M" |
| The default message format. More... | |
| static constexpr const char * | DEFAULT_TIME_FORMAT = "%Y-%m-%d %H:%M:%S,%f" |
| The default time format. More... | |
| static const char | SLOT = 's' |
| For slot and event number from EventContext. More... | |
| static const char | EVTNUM = 'e' |
| static const char | THREAD = 'X' |
Friends | |
| std::ostream & | operator<< (std::ostream &stream, const Message &msg) |
| Insert the message into a stream. More... | |
| bool | operator== (const Message &a, const Message &b) |
| Insert the message into a stream. More... | |
The Message class.
This class is used to contain messages which can then be formatted and sent to a message service
| Message::Message | ( | ) |
Default constructor.
Definition at line 31 of file Message.cpp.
| Message::Message | ( | const char * | src, |
| int | type, | ||
| const char * | msg | ||
| ) |
Constructor.
Definition at line 44 of file Message.cpp.
| Message::Message | ( | std::string | src, |
| int | type, | ||
| std::string | msg | ||
| ) |
Constructor.
Definition at line 57 of file Message.cpp.
|
default |
Default destructor.
|
private |
Decode format.
Definition at line 252 of file Message.cpp.
|
static |
Get the default format string.
Definition at line 162 of file Message.cpp.
|
static |
Get the default time format string.
Definition at line 194 of file Message.cpp.
| const std::string & Message::getFormat | ( | ) | const |
| const std::string & Message::getMessage | ( | ) | const |
| const std::string & Message::getSource | ( | ) | const |
| const std::string & Message::getTimeFormat | ( | ) | const |
| int Message::getType | ( | ) | const |
|
private |
Called when an invalid format string is encountered.
Definition at line 367 of file Message.cpp.
|
private |
Format the message.
Definition at line 214 of file Message.cpp.
| bool Message::operator< | ( | const Message & | test | ) |
| void Message::setFormat | ( | std::string | msg | ) | const |
Set the format string.
Definition at line 171 of file Message.cpp.
| void Message::setMessage | ( | std::string | msg | ) |
| void Message::setSource | ( | std::string | src | ) |
| void Message::setTimeFormat | ( | std::string | timeFormat | ) | const |
Set the time format string.
Definition at line 203 of file Message.cpp.
| void Message::setType | ( | int | msg_type | ) |
|
private |
Set the width of a stream.
Definition at line 388 of file Message.cpp.
|
private |
Truncate or pad the output string to the field width as necessary.
Definition at line 404 of file Message.cpp.
|
friend |
Insert the message into a stream.
Definition at line 119 of file Message.cpp.
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
mutableprivate |
|
mutableprivate |
|
mutableprivate |
|
private |
|
private |
|
mutableprivate |
|
mutableprivate |
|
staticprivate |
|
staticprivate |
For slot and event number from EventContext.
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |