#include <GaudiKernel/Message.h>
Public Member Functions | |
Message () | |
Default constructor. | |
Message (const char *src, int type, const char *msg) | |
Constructor. | |
Message (const std::string &src, int type, const std::string &msg) | |
Constructor. | |
~Message () | |
Default destructor. | |
const std::string & | getMessage () const |
Get the message string. | |
void | setMessage (const std::string &msg) |
Set the message string. | |
int | getType () const |
Get the message type. | |
void | setType (int msg_type) |
Set the message type. | |
const std::string & | getSource () const |
Get the message source. | |
void | setSource (const std::string &src) |
Set the message source. | |
const std::string & | getFormat () const |
Get the format string. | |
void | setFormat (const std::string &msg) const |
Set the format string. | |
const std::string & | getTimeFormat () const |
Get the time format string. | |
void | setTimeFormat (const std::string &timeFormat) const |
Set the time format string. | |
bool | operator< (const Message &test) |
Needed to build maps. | |
Static Public Member Functions | |
static const std::string | getDefaultFormat () |
Get the default format string. | |
static const std::string | getDefaultTimeFormat () |
Get the default time format string. | |
Protected Member Functions | |
void | invalidFormat () const |
Called when an invalid format string is encountered. | |
void | makeFormattedMsg (const std::string &format) const |
Format the message. | |
void | decodeFormat (const std::string &format) const |
Decode format. | |
void | sizeField (const std::string &text) const |
Truncate or pad the output string to the field width as necessary. | |
void | setWidth (const std::string &formatArg) const |
Set the width of a stream. | |
Protected Attributes | |
std::string | m_message |
The message. | |
std::string | m_source |
The source. | |
std::string | m_format |
The format string. | |
std::string | m_time_format |
Time format string. | |
int | m_type |
The type. | |
std::string | m_formatted_msg |
Formatted message. | |
char | m_fill |
The current fill character. | |
int | m_width |
The current field width. | |
bool | m_left |
Justification. | |
Static Protected Attributes | |
static const char | FORMAT_PREFIX |
The character used to prefix formatting commands. | |
static const char | JUSTIFY_LEFT |
The character used to indicate start of left text justification. | |
static const char | JUSTIFY_RIGHT |
The character used to indicate start of right text justification. | |
static const char | MESSAGE |
The character used to indicate that the message should be printed. | |
static const char | TYPE |
The character used to indicate that the message type should be printed. | |
static const char | TIME |
The character used to indicate that the message timestamp should be printed. | |
static const char | UTIME |
The character used to indicate that the message timestamp should be printed in UTC time. | |
static const char | SOURCE |
The character used to indicate that the message source should be printed. | |
static const char | FILL |
The character used to indicate that the previous character is to be used for padding out fields if the text is not long enough. | |
static const char | WIDTH |
The character used to indicate that the previous decimal characters should be taken as the field width. | |
static const char * | DEFAULT_FORMAT |
The default message format. | |
static const char * | DEFAULT_TIME_FORMAT |
The default time format. | |
Friends | |
std::ostream & | operator<< (std::ostream &stream, const Message &msg) |
Insert the message into a stream. | |
bool | operator== (const Message &a, const Message &b) |
Insert the message into a stream. |
This class is used to contain messages which can then be formatted and sent to a message service
Definition at line 15 of file Message.h.
Message::Message | ( | ) |
Default constructor.
Message::Message | ( | const char * | src, | |
int | type, | |||
const char * | msg | |||
) |
Constructor.
Message::Message | ( | const std::string & | src, | |
int | type, | |||
const std::string & | msg | |||
) |
Constructor.
const std::string& Message::getMessage | ( | ) | const |
Get the message string.
void Message::setMessage | ( | const std::string & | msg | ) |
Set the message string.
int Message::getType | ( | ) | const |
Get the message type.
void Message::setType | ( | int | msg_type | ) |
Set the message type.
const std::string& Message::getSource | ( | ) | const |
Get the message source.
void Message::setSource | ( | const std::string & | src | ) |
Set the message source.
const std::string& Message::getFormat | ( | ) | const |
Get the format string.
static const std::string Message::getDefaultFormat | ( | ) | [static] |
Get the default format string.
void Message::setFormat | ( | const std::string & | msg | ) | const |
Set the format string.
const std::string& Message::getTimeFormat | ( | ) | const |
Get the time format string.
static const std::string Message::getDefaultTimeFormat | ( | ) | [static] |
Get the default time format string.
void Message::setTimeFormat | ( | const std::string & | timeFormat | ) | const |
Set the time format string.
bool Message::operator< | ( | const Message & | test | ) |
Needed to build maps.
void Message::invalidFormat | ( | ) | const [protected] |
Called when an invalid format string is encountered.
void Message::makeFormattedMsg | ( | const std::string & | format | ) | const [protected] |
Format the message.
void Message::decodeFormat | ( | const std::string & | format | ) | const [protected] |
Decode format.
void Message::sizeField | ( | const std::string & | text | ) | const [protected] |
Truncate or pad the output string to the field width as necessary.
void Message::setWidth | ( | const std::string & | formatArg | ) | const [protected] |
Set the width of a stream.
std::ostream& operator<< | ( | std::ostream & | stream, | |
const Message & | msg | |||
) | [friend] |
Insert the message into a stream.
std::string Message::m_message [protected] |
std::string Message::m_source [protected] |
std::string Message::m_format [mutable, protected] |
std::string Message::m_time_format [mutable, protected] |
int Message::m_type [protected] |
std::string Message::m_formatted_msg [mutable, protected] |
char Message::m_fill [mutable, protected] |
int Message::m_width [mutable, protected] |
bool Message::m_left [mutable, protected] |
const char Message::FORMAT_PREFIX [static, protected] |
const char Message::JUSTIFY_LEFT [static, protected] |
const char Message::JUSTIFY_RIGHT [static, protected] |
const char Message::MESSAGE [static, protected] |
const char Message::TYPE [static, protected] |
const char Message::TIME [static, protected] |
const char Message::UTIME [static, protected] |
const char Message::SOURCE [static, protected] |
const char Message::FILL [static, protected] |
const char Message::WIDTH [static, protected] |
const char* Message::DEFAULT_FORMAT [static, protected] |
const char* Message::DEFAULT_TIME_FORMAT [static, protected] |