Tool::Message Class Reference

This class represents a Message. More...

#include <Message.hpp>

Inheritance diagram for Tool::Message:
Tool::Exception

List of all members.

Public Member Functions

 Message ()
 Default Constructor;.
 Message (const Message &message)
 Copy Constructor;.
 Message (const std::string &author, const std::string &title, const std::string &message, const MessageType &type)
 Message Constructor.
 Message (const std::string &author, const std::string &title, const std::string &message, const MessageType &type, const boost::posix_time::ptime &msgtime)
 Message Constructor.
virtual Messageoperator= (const Message &message)
 Copy Operator.
const std::string & getAuthor () const
 Get's the author of the message.
const std::string & getTitle () const
 Get's the title of the message.
const std::string & getMessage () const
 Get's the message of the message.
const MessageType & getType () const
 Get's the type of the message.
const boost::posix_time::ptime & getTime () const
 Get's the creation time of the message.

Static Public Member Functions

static std::string convertToString (const MessageType &type)
 Converts a MessageType to the corresponding string.
static std::string convertToString (const boost::posix_time::ptime &time, const std::string &format)
 Formats the boost::posix_time as specified.

Protected Attributes

std::string author
 the author
std::string title
 the title message
std::string message
 the message
MessageType type
 the type of the message
boost::posix_time::ptime msgtime
 the creation time

Detailed Description

This class represents a Message.

It stores a string author, the string message, a MessageType type, and the creation time.


Constructor & Destructor Documentation

Tool::Message::Message (  ) 

Default Constructor;.

Creates a Message with an empty author, empty message, the Default MessageType and the creation time.

Tool::Message::Message ( const Message message  ) 

Copy Constructor;.

Creates an identical Message.

Tool::Message::Message ( const std::string &  author,
const std::string &  title,
const std::string &  message,
const MessageType &  type 
)

Message Constructor.

Creates a new Message, with the specified author, specified message, type, and the creation time.

Tool::Message::Message ( const std::string &  author,
const std::string &  title,
const std::string &  message,
const MessageType &  type,
const boost::posix_time::ptime &  msgtime 
)

Message Constructor.

Creates a new Message, with the specified author, specified message, type, and the specified time.


Member Function Documentation

std::string Tool::Message::convertToString ( const boost::posix_time::ptime &  time,
const std::string &  format 
) [static]

Formats the boost::posix_time as specified.

Parameters:
a the MessageType to convert
format how the time should be formated
Returns:
the formated time string or an empty string if failed

Reimplemented in Tool::Exception.

std::string Tool::Message::convertToString ( const MessageType &  type  )  [static]

Converts a MessageType to the corresponding string.

Parameters:
a the MessageType to convert
Returns:
the MessageType as string
const std::string & Tool::Message::getAuthor (  )  const

Get's the author of the message.

Returns:
the author
const std::string & Tool::Message::getMessage (  )  const

Get's the message of the message.

Returns:
the message
const boost::posix_time::ptime & Tool::Message::getTime (  )  const

Get's the creation time of the message.

Returns:
the time

Reimplemented in Tool::Exception.

const std::string & Tool::Message::getTitle (  )  const

Get's the title of the message.

Returns:
the title of the message (brief header)
const MessageType & Tool::Message::getType (  )  const

Get's the type of the message.

Returns:
the type
Message & Tool::Message::operator= ( const Message message  )  [virtual]

Copy Operator.

Copies the data from the specified Message.


The documentation for this class was generated from the following files:

Generated by  doxygen 1.6.2