#include <source/ariba/utility/messages/Message.h>
Inherits VSerializeable.
Inherited by ariba::application::pingpong::PingPongMessage, ariba::application::pingpong::PingPongMessage, ariba::utility::PeriodicBroadcastMessage, and TextMessage.

Classes | |
| class | PayloadSerializer |
Public Member Functions | |
| Message () | |
| Message (const Data &data) | |
| void | dropPayload () |
| void | setReleasePayload (bool release) |
| Data | getPayload () const |
| void | setPayload (const Data &payload) |
| virtual | ~Message () |
| std::string | toString () const |
| void | setDestinationAddress (const Address *addr) |
| const Address * | getDestinationAddress () const |
| void | setSourceAddress (const Address *addr) |
| const Address * | getSourceAddress () const |
| virtual const char * | getDescription () const |
| virtual Message * | createReturnMessage () const |
| void | encapsulate (Message *message, int variant=DEFAULT_V) |
| template<class T > | |
| T * | decapsulate () |
| template<class T > | |
| T * | convert () |
Protected Member Functions | |
| finline PayloadSerializer | Payload (size_t length=~0) |
Protected Attributes | |
| shared_array< uint8_t > | root |
| bool | releasePayload |
| Data | payload |
| const Address * | srcAddr |
| const Address * | destAddr |
Private Attributes | |
| VSERIALIZEABLE | |
Friends | |
| std::ostream & | operator<< (std::ostream &stream, const ariba::utility::Message &msg) |
This class implements an abstract message format.
Definition at line 78 of file Message.h.
| Message::Message | ( | ) | [inline] |
| Message::Message | ( | const Data & | data | ) | [inline, explicit] |
Constructs a new "root" message by copying the data described by data.
Definition at line 107 of file Message.h.
References DataTpl< T, DataModel >::clone(), and payload.
| Message::~Message | ( | ) | [virtual] |
| T* Message::convert | ( | ) | [inline] |
The same as decapsulate, but this function is used in the samples to make the semantics easier to understand. The semantics is shown to be: you get a message and convert it to your type. Not as: you get a message and have to extract your message from it.
Definition at line 224 of file Message.h.
Referenced by ariba::application::pingpong::PingPong::onMessage().
| Message * Message::createReturnMessage | ( | ) | const [virtual] |
Returns a return message, that can be used to send a message back to the recipient or NULL if no message can be returned. The default implementation returns NULL.
Definition at line 72 of file Message.cpp.
| T* Message::decapsulate | ( | ) | [inline] |
Decapsulates message. In case the message has not been deserialized, this method class serialization to get an object.
Definition at line 207 of file Message.h.
References data_deserialize(), DataTpl< T, DataModel >::isUnspecified(), and payload.
| void Message::dropPayload | ( | ) | [inline] |
Definition at line 113 of file Message.h.
References payload, DataTpl< T, DataModel >::release(), and releasePayload.
Referenced by encapsulate(), and ~Message().
Encapsulate a message into the payload.
| message | The message to be encapsulated. |
Definition at line 193 of file Message.h.
References data_serialize(), dropPayload(), DataTpl< T, DataModel >::isUnspecified(), and payload.
| const char * Message::getDescription | ( | ) | const [virtual] |
Returns a short human-readable description of this message
Definition at line 63 of file Message.cpp.
| const Address* Message::getDestinationAddress | ( | ) | const [inline] |
| Data Message::getPayload | ( | ) | const [inline] |
| const Address* Message::getSourceAddress | ( | ) | const [inline] |
| finline PayloadSerializer Message::Payload | ( | size_t | length = ~0 |
) | [inline, protected] |
| void Message::setDestinationAddress | ( | const Address * | addr | ) | [inline] |
| void Message::setPayload | ( | const Data & | payload | ) | [inline] |
| void Message::setReleasePayload | ( | bool | release | ) | [inline] |
Definition at line 117 of file Message.h.
References releasePayload.
| void Message::setSourceAddress | ( | const Address * | addr | ) | [inline] |
| std::string Message::toString | ( | ) | const |
Definition at line 76 of file Message.cpp.
| std::ostream& operator<< | ( | std::ostream & | stream, | |
| const ariba::utility::Message & | msg | |||
| ) | [friend] |
Definition at line 84 of file Message.cpp.
const Address* Message::destAddr [protected] |
Definition at line 93 of file Message.h.
Referenced by getDestinationAddress(), and setDestinationAddress().
Data Message::payload [protected] |
Definition at line 89 of file Message.h.
Referenced by decapsulate(), dropPayload(), encapsulate(), getPayload(), Message(), and Message::PayloadSerializer::sznMethodBegin().
bool Message::releasePayload [protected] |
Definition at line 88 of file Message.h.
Referenced by dropPayload(), setReleasePayload(), and Message::PayloadSerializer::sznMethodBegin().
shared_array<uint8_t> Message::root [protected] |
const Address* Message::srcAddr [protected] |
Definition at line 92 of file Message.h.
Referenced by getSourceAddress(), and setSourceAddress().
Message::VSERIALIZEABLE [private] |
Reimplemented in ariba::utility::PeriodicBroadcastMessage, and ariba::application::pingpong::PingPongMessage.
1.6.1