| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Message Class Reference

The Message class. More...

#include <GaudiKernel/Message.h>

List of all members.


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.

Detailed Description

The Message class.

This class is used to contain messages which can then be formatted and sent to a message service

Author:
Iain Last

Definition at line 15 of file Message.h.


Constructor & Destructor Documentation

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.

Message::~Message (  )  [inline]

Default destructor.

Definition at line 27 of file Message.h.

00027 {}


Member Function Documentation

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.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  stream,
const Message msg 
) [friend]

Insert the message into a stream.

bool operator== ( const Message a,
const Message b 
) [friend]

Insert the message into a stream.


Member Data Documentation

std::string Message::m_message [protected]

The message.

Definition at line 91 of file Message.h.

std::string Message::m_source [protected]

The source.

Definition at line 94 of file Message.h.

std::string Message::m_format [mutable, protected]

The format string.

Definition at line 97 of file Message.h.

std::string Message::m_time_format [mutable, protected]

Time format string.

Definition at line 100 of file Message.h.

int Message::m_type [protected]

The type.

Definition at line 103 of file Message.h.

std::string Message::m_formatted_msg [mutable, protected]

Formatted message.

Definition at line 106 of file Message.h.

char Message::m_fill [mutable, protected]

The current fill character.

Definition at line 109 of file Message.h.

int Message::m_width [mutable, protected]

The current field width.

Definition at line 112 of file Message.h.

bool Message::m_left [mutable, protected]

Justification.

Definition at line 115 of file Message.h.

const char Message::FORMAT_PREFIX [static, protected]

The character used to prefix formatting commands.

Definition at line 118 of file Message.h.

const char Message::JUSTIFY_LEFT [static, protected]

The character used to indicate start of left text justification.

Definition at line 121 of file Message.h.

const char Message::JUSTIFY_RIGHT [static, protected]

The character used to indicate start of right text justification.

Definition at line 124 of file Message.h.

const char Message::MESSAGE [static, protected]

The character used to indicate that the message should be printed.

Definition at line 127 of file Message.h.

const char Message::TYPE [static, protected]

The character used to indicate that the message type should be printed.

Definition at line 130 of file Message.h.

const char Message::TIME [static, protected]

The character used to indicate that the message timestamp should be printed.

Definition at line 133 of file Message.h.

const char Message::UTIME [static, protected]

The character used to indicate that the message timestamp should be printed in UTC time.

Definition at line 137 of file Message.h.

const char Message::SOURCE [static, protected]

The character used to indicate that the message source should be printed.

Definition at line 140 of file Message.h.

const char Message::FILL [static, protected]

The character used to indicate that the previous character is to be used for padding out fields if the text is not long enough.

Definition at line 145 of file Message.h.

const char Message::WIDTH [static, protected]

The character used to indicate that the previous decimal characters should be taken as the field width.

Definition at line 150 of file Message.h.

const char* Message::DEFAULT_FORMAT [static, protected]

The default message format.

Definition at line 153 of file Message.h.

const char* Message::DEFAULT_TIME_FORMAT [static, protected]

The default time format.

Definition at line 156 of file Message.h.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 19:57:12 2011 for GaudiKernel by doxygen 1.4.7