#include <Message.h>
Inheritance diagram for rwil::Message::

Public Methods | |
| Message (std::string deviceName, std::string command) | |
| Initialize a message with device and command parameters the default timestamp of now. More... | |
| Message (std::string deviceName, std::string command, time_t when) | |
| Initialize a message with device and command parameters with a specified timestamp. More... | |
| Message (std::map< std::string, std::string > params) | |
| Initialize a message with a map of parameters and the default timestamp of now. More... | |
| Message (std::map< std::string, std::string > params, time_t when) | |
| Initialize a message with a map of parameters and a specified timestamp. More... | |
| Message (const Message &msg) | |
| Copy constructor. More... | |
| const std::string & | GetDevice () const |
| Get the value of the "device" parameter. More... | |
| const std::string & | GetCommand () const |
| Get the value of the "command" parameter. More... | |
| bool | operator< (const Message &rhs) |
| Less than operator used to maintain order in the MessageList class. More... | |
| void | SetParam (std::string n, std::string param) |
| Sets the value of a parameter. More... | |
| std::string | GetParam (std::string n) const |
| Gets the value of a parameter. More... | |
| time_t | GetWhen () const |
| Gets the timestamp associated with the message. More... | |
| const std::map< std::string, std::string > & | GetMap () const |
| Gets the internal data structure used to maintain state. More... | |
Private Attributes | |
| std::map< std::string, std::string > | m_parameters |
| The parameters of the message. More... | |
| const time_t | m_when |
| The message timestamp. More... | |
Definition at line 9 of file Message.h.
|
||||||||||||
|
Initialize a message with device and command parameters the default timestamp of now.
Definition at line 7 of file Message.cpp. References m_parameters.
00007 : m_when(time(0)) 00008 { 00009 m_parameters["device"] = deviceName; 00010 m_parameters["command"] = command; 00011 } |
|
||||||||||||||||
|
Initialize a message with device and command parameters with a specified timestamp.
Definition at line 13 of file Message.cpp. References m_parameters.
00013 : m_when(when) 00014 { 00015 m_parameters["device"] = deviceName; 00016 m_parameters["command"] = command; 00017 } |
|
|
Initialize a message with a map of parameters and the default timestamp of now.
Definition at line 19 of file Message.cpp.
00019 : m_parameters(params), m_when(time(0)) 00020 { 00021 } |
|
||||||||||||
|
Initialize a message with a map of parameters and a specified timestamp.
Definition at line 23 of file Message.cpp.
00023 : m_parameters(params), m_when(when) 00024 { 00025 } |
|
|
Copy constructor.
Definition at line 27 of file Message.cpp.
00027 : m_parameters(msg.m_parameters), m_when(msg.m_when) {} |
|
|
Get the value of the "command" parameter.
Definition at line 31 of file Message.cpp. References m_parameters.
00031 { return m_parameters["command"]; }
|
|
|
Get the value of the "device" parameter.
Definition at line 30 of file Message.cpp. References m_parameters.
00030 { return m_parameters["device"]; }
|
|
|
Gets the internal data structure used to maintain state.
Definition at line 42 of file Message.cpp. References m_parameters.
00042 { return m_parameters; }
|
|
|
Gets the value of a parameter. If the parameter is not defined then returns ""
Definition at line 39 of file Message.cpp. References m_parameters.
00039 { return m_parameters[n]; }
|
|
|
Gets the timestamp associated with the message. Get the value of the timestamp
Definition at line 41 of file Message.cpp. References m_when.
00041 { return m_when; }
|
|
|
Less than operator used to maintain order in the MessageList class. Return true if the timestamp is less than that of rhs's
Definition at line 33 of file Message.cpp. References m_when.
00034 {
00035 return this->m_when < rhs.m_when;
00036 }
|
|
||||||||||||
|
Sets the value of a parameter.
Definition at line 38 of file Message.cpp. References m_parameters. Referenced by rwil::EncapsulatingMessage::EncapsulatingMessage(), and rwil::SetRetriesMessage::SetRetriesMessage().
00038 { m_parameters[n] = param; }
|
|
|
The parameters of the message.
Definition at line 89 of file Message.h. Referenced by GetCommand(), GetDevice(), GetMap(), GetParam(), Message(), and SetParam(). |
|
|
The message timestamp.
|
1.2.12 written by Dimitri van Heesch,
© 1997-2001