S3FC project page | S3FC home page |
#include <s3_message.h>
Inheritance diagram for s3_message:
Public Types | |
typedef std::string | msg_id_t |
enum | msg_class_t { NORMAL, PRIORITY, CONTROL } |
Message class enumeration. More... | |
Public Methods | |
s3_message () | |
Default contructor - instantiate an empty message. More... | |
s3_message (const std::string &n_from, const std::string &n_to, const std::string &n_body, const msg_class_t &n_mc, const msg_id_t &n_id) | |
Initialising contructor - instantiate a message with the supplied values. More... | |
s3_message (const std::string &n_from, const s3_message &msg, const std::string &n_body, const msg_id_t &n_id) | |
Instantiate and return a reply message with the supplied values. More... | |
virtual | ~s3_message () |
Destructor - deallocate all resources. More... | |
virtual void | pack (s3_pack_buffer &b) const |
Pack contents into s3_pack_buffer . More... | |
virtual void | unpack (const s3_pack_buffer &b) |
Unpack contents from s3_pack_buffer . More... | |
bool | is_empty () const |
Test whether this is an empty message. More... | |
bool | is_reply (const msg_id_t &n_id) const |
Test whether this message is a reply to a message with the supplied message ID. More... | |
std::string | get_from () const |
Return the sender name. More... | |
std::string | get_to () const |
Return the destination name. More... | |
std::string | get_body () const |
Return the message body. More... | |
msg_class_t | get_class () const |
Return the message class. More... | |
std::string | get_debug_str () const |
Public Attributes | |
S3_DECLARE_MAGIC_STRING | |
Protected Attributes | |
bool | empty |
true if this is an empty message. More... | |
std::string | from |
The sender. More... | |
std::string | to |
The destination. More... | |
std::string | body |
Message content. More... | |
msg_class_t | mc |
Message class. More... | |
msg_id_t | id |
Message ID. More... | |
msg_id_t | reply_id |
ID of message to which is being replied if this is a reply message. More... |
The from
, to
and body
attributes are represented by string
instances. The message class, class
, is of a nested enumerated type: s3_message::msg_class_t
. This instance is derived from s3_streamable
and can therefore be packed and transported across a network.
Definition at line 338 of file s3_message.h.
|
Definition at line 341 of file s3_message.h. Referenced by s3_message_box::reply_msg, and s3_message_box::send_msg. |
|
Message class enumeration.
Definition at line 345 of file s3_message.h. Referenced by get_class. |
|
Default contructor - instantiate an empty message.
Definition at line 42 of file s3_message.cc. |
|
Initialising contructor - instantiate a message with the supplied values.
Definition at line 54 of file s3_message.cc. |
|
Instantiate and return a reply message with the supplied values.
This is equivalent to:
Definition at line 70 of file s3_message.cc. |
|
Destructor - deallocate all resources.
Definition at line 85 of file s3_message.cc. |
|
Return the message body.
Definition at line 138 of file s3_message.cc. References body. Referenced by s3_post_office::add_dst_switch, s3_rpc_server::handle_message, s3_msgb_log_rx_thread::main_loop, s3_post_office::remove_dst_switch, and s3_rpc_server::reply_client. |
|
Return the message class.
Definition at line 144 of file s3_message.cc. References mc, and msg_class_t. Referenced by s3_message_box::deliver_msg. |
|
Definition at line 150 of file s3_message.cc. References body, CONTROL, from, id, is_empty, NORMAL, PRIORITY, reply_id, and to. Referenced by s3_post_office::add_dst_switch, s3_post_office_switch::forward_msg, and s3_post_office::remove_dst_switch. |
|
Return the sender name.
Definition at line 126 of file s3_message.cc. References from. Referenced by s3_rpc_server::reply_client. |
|
Return the destination name.
Definition at line 132 of file s3_message.cc. References to. |
|
Test whether this is an empty message.
Definition at line 114 of file s3_message.cc. References empty. Referenced by get_debug_str, s3_rpc_server::handle_message, and s3_msgb_log_rx_thread::main_loop. |
|
Test whether this message is a reply to a message with the supplied message ID.
Definition at line 120 of file s3_message.cc. References reply_id. |
|
Pack contents into
Implements s3_streamable. Definition at line 90 of file s3_message.cc. References body, empty, from, id, mc, s3_streamable::pack, reply_id, and to. |
|
Unpack contents from
Implements s3_streamable. Definition at line 102 of file s3_message.cc. References body, empty, from, id, mc, reply_id, to, and s3_streamable::unpack. |
|
Message content.
Definition at line 376 of file s3_message.h. Referenced by get_body, get_debug_str, pack, and unpack. |
|
Definition at line 364 of file s3_message.h. |
|
The sender.
Definition at line 368 of file s3_message.h. Referenced by get_debug_str, get_from, pack, and unpack. |
|
Message ID.
Definition at line 384 of file s3_message.h. Referenced by get_debug_str, pack, and unpack. |
|
Message class.
Definition at line 380 of file s3_message.h. |
|
ID of message to which is being replied if this is a reply message.
Definition at line 388 of file s3_message.h. Referenced by get_debug_str, is_reply, pack, and unpack. |
|
Definition at line 390 of file s3_message.h. |
|
The destination.
Definition at line 372 of file s3_message.h. Referenced by get_debug_str, get_to, pack, and unpack. |
Send comments to: s3fc@stonethree.com |
|