The Message class provides an immutable, fixed-length array. More...
#include <message.hpp>
Public Member Functions | |
Message () | |
Message (const ActorRef &sender, const ActorRef &receiver) | |
Message (const ActorRef &sender, const ActorRef &receiver, const Any &value) | |
Creates a message with one element. | |
Message (const ActorRef &sender, const ActorRef &receiver, const Any &v1, const Any &v2) | |
Creates a message with two elements. | |
Message (const ActorRef &sender, const ActorRef &receiver, const Any &v1, const Any &v2, const Any &v3) | |
Creates a message with three elements. | |
Message (const ActorRef &sender, const ActorRef &receiver, const Any &v1, const Any &v2, const Any &v3, const Any &v4) | |
Creates a message with four elements. | |
Message (const ActorRef &sender, const ActorRef &receiver, const Any &v1, const Any &v2, const Any &v3, const Any &v4, const Any &v5) | |
Creates a message with five elements. | |
Message (const ActorRef &sender, const ActorRef &receiver, const Any &v1, const Any &v2, const Any &v3, const Any &v4, const Any &v5, const Any &v6) | |
Creates a message with six elements. | |
Message (const ActorRef &sender, const ActorRef &receiver, const Any &v1, const Any &v2, const Any &v3, const Any &v4, const Any &v5, const Any &v6, const Any &v7) | |
Creates a message with seven elements. | |
Message (const ActorRef &sender, const ActorRef &receiver, const Any &v1, const Any &v2, const Any &v3, const Any &v4, const Any &v5, const Any &v6, const Any &v7, const Any &v8) | |
Creates a message with eight elements. | |
Message (const ActorRef &sender, const ActorRef &receiver, const Any &v1, const Any &v2, const Any &v3, const Any &v4, const Any &v5, const Any &v6, const Any &v7, const Any &v8, const Any &v9) | |
Creates a message with nine elements. | |
Message (const Message &other) | |
~Message () | |
Message & | operator= (const Message &other) |
bool | operator== (const Message &other) const |
virtual boost::uint32_t | length () const |
ActorRef & | sender () const |
ActorRef & | receiver () const |
virtual const Any & | at (boost::uint32_t pos) const |
String | toString (bool verbose=false) const |
Try to display this message as a string. | |
virtual bool | isMessage () const |
Serializes this message to a String. |
The Message class provides an immutable, fixed-length array.
All elements are stored in instances of Any. Messages are implicitly shared and due to their immutable behavior thread safe.
Definition at line 68 of file message.hpp.
acedia::Message::Message | ( | ) |
Default constructor (create an empty, invalid message).
Definition at line 107 of file message.cpp.
Default constructor (create an empty message with sender).
Definition at line 117 of file message.cpp.
acedia::Message::Message | ( | const Message & | other | ) |
Copy constructor.
Definition at line 187 of file message.cpp.
acedia::Message::~Message | ( | ) |
Destructor.
Definition at line 192 of file message.cpp.
const Any & acedia::Message::at | ( | boost::uint32_t | pos | ) | const [virtual] |
pos
IndexOutOfBoundsException | if pos >= length() |
Implements acedia::AnyArray.
Definition at line 223 of file message.cpp.
bool acedia::Message::isMessage | ( | ) | const [virtual] |
Serializes this message to a String.
str
and return the deserialized message. NotDeserializableException | if str could not be deserialized Overrides AnyArray::isMessage(). |
Reimplemented from acedia::AnyArray.
Definition at line 321 of file message.cpp.
boost::uint32_t acedia::Message::length | ( | ) | const [virtual] |
Implements acedia::AnyArray.
Definition at line 218 of file message.cpp.
Assigns all elements from other
to this.
Definition at line 210 of file message.cpp.
bool acedia::Message::operator== | ( | const Message & | other | ) | const |
Definition at line 229 of file message.cpp.
ActorRef & acedia::Message::receiver | ( | ) | const |
Definition at line 205 of file message.cpp.
ActorRef & acedia::Message::sender | ( | ) | const |
Definition at line 200 of file message.cpp.
String acedia::Message::toString | ( | bool | verbose = false |
) | const |
Try to display this message as a string.
This method tries to display the message content as a string. This is no serialization! By default this method can convert only a few datatypes to strings (namely: all primitive data types plus String and - of course - tuples). If you want to extend this feature see ToStringConverter.
Definition at line 299 of file message.cpp.