#include <BaseMessage.h>

We do not document its protected members because they are intended only for internal library use.
Definition at line 59 of file BaseMessage.h.
Public Types | |
| enum | Service { Unreliable = UNRELIABLE_MESS, Reliable = RELIABLE_MESS, FIFO = FIFO_MESS, Causal = CAUSAL_MESS, Agreed = AGREED_MESS, Safe = SAFE_MESS, SelfDiscard = SELF_DISCARD, DropReceive = DROP_RECV, SERVICE_TYPE_DISCARD, ReliableSelfDiscard = Reliable | SelfDiscard, FIFOSelfDiscard = FIFO | SelfDiscard, CausalSelfDiscard = Causal | SelfDiscard, AgreedSelfDiscard = Agreed | SelfDiscard, SafeSelfDiscard = Safe | SelfDiscard } |
| Service is not a proper enumeration, but rather a specification of constants corresponding to the Spread service type flags. More... | |
| typedef Spread::int16 | message_type |
| Defines the type for 16-bit message type identifiers. | |
| typedef Spread::service | service_type |
| Defines the type for specifying service types. | |
Public Member Functions | |
| virtual | ~BaseMessage () |
| Virtual destructor. | |
| virtual unsigned int | size () const =0 throw () |
| Returns the number of bytes in the message. | |
| virtual void | clear ()=0 |
| Clears the message for reuse, resetting its size to zero. | |
| void | get_membership_info (MembershipInfo &info) const throw (Error) |
| Extracts the membership information contained in this message and stores it in the supplied MembershipInfo object. | |
| void | set_service (const service_type service) throw () |
| Sets the service type of the message. | |
| service_type | service () const throw () |
| Returns the service type requested (for sends) or sent under (for receives) of the message. | |
| void | set_type (const message_type type) throw () |
| Sets the message type identifier. | |
| message_type | type () const throw () |
| Returns the type of the message. | |
| void | set_sender (const string &sender) |
| Sets the message sender. | |
| const string & | sender () const throw () |
| Returns the message sender. | |
| void | set_endian_mismatch (const bool mismatch=true) throw () |
| Sets the endian mismatch flag to the specified value. | |
| bool | endian_mismatch () const throw () |
| Returns true if there is an endian mismatch between sender and receiver, false otherwise. | |
| void | set_agreed () throw () |
| Sets the service type to BaseMessage::Agreed. | |
| bool | is_agreed () const throw () |
| Returns true if service type is BaseMessage::Agreed, false otherwise. | |
| void | set_causal () throw () |
| Sets the service type to BaseMessage::Causal. | |
| bool | is_causal () const throw () |
| Returns true if service type is BaseMessage::Causal, false otherwise. | |
| void | set_fifo () throw () |
| Sets the service type to BaseMessage::FIFO. | |
| bool | is_fifo () const throw () |
| Returns true if service type is BaseMessage::FIFO, false otherwise. | |
| void | set_reliable () throw () |
| Sets the service type to BaseMessage::Reliable. | |
| bool | is_reliable () const throw () |
| Returns true if service type is BaseMessage::Reliable, false otherwise. | |
| void | set_unreliable () throw () |
| Sets the service type to BaseMessage::Unreliable. | |
| bool | is_unreliable () const throw () |
| Returns true if service type is BaseMessage::Unreliable, false otherwise. | |
| void | set_safe () throw () |
| Sets the service type to BaseMessage::Safe. | |
| bool | is_safe () const throw () |
| Returns true if service type is BaseMessage::Safe, false otherwise. | |
| void | set_self_discard (const bool discard=true) throw () |
| Adds or removes the BaseMessage::SelfDiscard flag to or from the service type. | |
| bool | is_self_discard () const throw () |
| Returns true if service type has the BaseMessage::SelfDiscard flag set, false otherwise. | |
| bool | is_regular () const throw () |
| Returns true if this is a regular data (as opposed to membership) message, false otherwise. | |
| bool | is_membership () const throw () |
| Returns true if this is a membership message, false otherwise. | |
Protected Member Functions | |
| BaseMessage () | |
| Initializes the class with a message type equal to 0, service type equal to Safe, endian mismatch equal to false, and a zero-length string for the sender. | |
| virtual int | sp_get_membership_info (Spread::membership_info *info) const =0 |
| virtual int | sp_get_vs_set_members (const Spread::vs_set_info *vs_set, Spread::group_type member_names[], unsigned int member_names_count) const =0 |
| virtual int | sp_get_vs_sets_info (Spread::vs_set_info *vs_sets, unsigned int num_vs_sets, unsigned int *index) const =0 |
Protected Attributes | |
| message_type | _type |
| service_type | _service_type |
| bool | _endian_mismatch |
| string | _sender |
| typedef Spread::int16 sava::spread::BaseMessage::message_type |
| typedef Spread::service sava::spread::BaseMessage::service_type |
Service is not a proper enumeration, but rather a specification of constants corresponding to the Spread service type flags.
We do not document the meaning of these flags here. See the Spread C API documentation to understand their meaning. We will note, however, that DropReceive is not a service type, but rather a flag instructing the Spread receive functions to truncate messages and group lists if the buffers are too small. There should be no need to use this constant in the API as it is handled by Mailbox::set_drop_receive.
| Unreliable | |
| Reliable | |
| FIFO | |
| Causal | |
| Agreed | |
| Safe | |
| SelfDiscard | |
| DropReceive | |
| SERVICE_TYPE_DISCARD | |
| ReliableSelfDiscard | |
| FIFOSelfDiscard | |
| CausalSelfDiscard | |
| AgreedSelfDiscard | |
| SafeSelfDiscard |
Definition at line 80 of file BaseMessage.h.
| sava::spread::BaseMessage::BaseMessage | ( | ) | [inline, protected] |
Initializes the class with a message type equal to 0, service type equal to Safe, endian mismatch equal to false, and a zero-length string for the sender.
Definition at line 122 of file BaseMessage.h.
| virtual sava::spread::BaseMessage::~BaseMessage | ( | ) | [inline, virtual] |
| virtual int sava::spread::BaseMessage::sp_get_membership_info | ( | Spread::membership_info * | info | ) | const [protected, pure virtual] |
Implemented in sava::spread::Message, and sava::spread::ScatterMessage.
| virtual int sava::spread::BaseMessage::sp_get_vs_set_members | ( | const Spread::vs_set_info * | vs_set, | |
| Spread::group_type | member_names[], | |||
| unsigned int | member_names_count | |||
| ) | const [protected, pure virtual] |
Implemented in sava::spread::Message, and sava::spread::ScatterMessage.
| virtual int sava::spread::BaseMessage::sp_get_vs_sets_info | ( | Spread::vs_set_info * | vs_sets, | |
| unsigned int | num_vs_sets, | |||
| unsigned int * | index | |||
| ) | const [protected, pure virtual] |
Implemented in sava::spread::Message, and sava::spread::ScatterMessage.
| virtual unsigned int sava::spread::BaseMessage::size | ( | ) | const throw () [pure virtual] |
Returns the number of bytes in the message.
Implemented in sava::spread::Message, and sava::spread::ScatterMessage.
| virtual void sava::spread::BaseMessage::clear | ( | ) | [pure virtual] |
Clears the message for reuse, resetting its size to zero.
Implemented in sava::spread::Message, and sava::spread::ScatterMessage.
| void sava::spread::BaseMessage::get_membership_info | ( | MembershipInfo & | info | ) | const throw (Error) |
Extracts the membership information contained in this message and stores it in the supplied MembershipInfo object.
Only call this method if the message is a membership message.
Warning: This method is available only when compiled against Spread 4.x and greater.
| info | A reference to a MembershipInfo that will store the membership information. |
| Error | If the structure of the message or its service type does not comprise a valid membership message. |
Definition at line 71 of file BaseMessage.cc.
References sava::spread::detail::Buffer< type >::resize(), and sava::spread::detail::Buffer< type >::size().
| void sava::spread::BaseMessage::set_service | ( | const service_type | service | ) | throw () [inline] |
Sets the service type of the message.
| service | The service type of the message. |
Definition at line 166 of file BaseMessage.h.
| service_type sava::spread::BaseMessage::service | ( | ) | const throw () [inline] |
Returns the service type requested (for sends) or sent under (for receives) of the message.
Definition at line 176 of file BaseMessage.h.
| void sava::spread::BaseMessage::set_type | ( | const message_type | type | ) | throw () [inline] |
Sets the message type identifier.
| type | The new message type. |
Definition at line 184 of file BaseMessage.h.
| message_type sava::spread::BaseMessage::type | ( | ) | const throw () [inline] |
Returns the type of the message.
Definition at line 192 of file BaseMessage.h.
| void sava::spread::BaseMessage::set_sender | ( | const string & | sender | ) | [inline] |
Sets the message sender.
| sender | The message sender. |
Definition at line 200 of file BaseMessage.h.
| const string& sava::spread::BaseMessage::sender | ( | ) | const throw () [inline] |
Returns the message sender.
This only has meaning for received messages.
Definition at line 208 of file BaseMessage.h.
| void sava::spread::BaseMessage::set_endian_mismatch | ( | const bool | mismatch = true |
) | throw () [inline] |
Sets the endian mismatch flag to the specified value.
| mismatch | The mismatch value. |
Definition at line 216 of file BaseMessage.h.
| bool sava::spread::BaseMessage::endian_mismatch | ( | ) | const throw () [inline] |
Returns true if there is an endian mismatch between sender and receiver, false otherwise.
This only has meaning for received messages.
Definition at line 226 of file BaseMessage.h.
| void sava::spread::BaseMessage::set_agreed | ( | ) | throw () [inline] |
| bool sava::spread::BaseMessage::is_agreed | ( | ) | const throw () [inline] |
Returns true if service type is BaseMessage::Agreed, false otherwise.
Definition at line 239 of file BaseMessage.h.
| void sava::spread::BaseMessage::set_causal | ( | ) | throw () [inline] |
| bool sava::spread::BaseMessage::is_causal | ( | ) | const throw () [inline] |
Returns true if service type is BaseMessage::Causal, false otherwise.
Definition at line 252 of file BaseMessage.h.
| void sava::spread::BaseMessage::set_fifo | ( | ) | throw () [inline] |
| bool sava::spread::BaseMessage::is_fifo | ( | ) | const throw () [inline] |
Returns true if service type is BaseMessage::FIFO, false otherwise.
Definition at line 265 of file BaseMessage.h.
| void sava::spread::BaseMessage::set_reliable | ( | ) | throw () [inline] |
| bool sava::spread::BaseMessage::is_reliable | ( | ) | const throw () [inline] |
Returns true if service type is BaseMessage::Reliable, false otherwise.
Definition at line 278 of file BaseMessage.h.
| void sava::spread::BaseMessage::set_unreliable | ( | ) | throw () [inline] |
| bool sava::spread::BaseMessage::is_unreliable | ( | ) | const throw () [inline] |
Returns true if service type is BaseMessage::Unreliable, false otherwise.
Definition at line 291 of file BaseMessage.h.
| void sava::spread::BaseMessage::set_safe | ( | ) | throw () [inline] |
| bool sava::spread::BaseMessage::is_safe | ( | ) | const throw () [inline] |
Returns true if service type is BaseMessage::Safe, false otherwise.
Definition at line 304 of file BaseMessage.h.
| void sava::spread::BaseMessage::set_self_discard | ( | const bool | discard = true |
) | throw () [inline] |
Adds or removes the BaseMessage::SelfDiscard flag to or from the service type.
| discard | true to set the BaseMessage::SelfDiscard flag, false to remove it. |
Definition at line 315 of file BaseMessage.h.
| bool sava::spread::BaseMessage::is_self_discard | ( | ) | const throw () [inline] |
Returns true if service type has the BaseMessage::SelfDiscard flag set, false otherwise.
Definition at line 327 of file BaseMessage.h.
| bool sava::spread::BaseMessage::is_regular | ( | ) | const throw () [inline] |
Returns true if this is a regular data (as opposed to membership) message, false otherwise.
Definition at line 336 of file BaseMessage.h.
| bool sava::spread::BaseMessage::is_membership | ( | ) | const throw () [inline] |
Returns true if this is a membership message, false otherwise.
Definition at line 344 of file BaseMessage.h.
message_type sava::spread::BaseMessage::_type [protected] |
Definition at line 112 of file BaseMessage.h.
service_type sava::spread::BaseMessage::_service_type [protected] |
Definition at line 113 of file BaseMessage.h.
bool sava::spread::BaseMessage::_endian_mismatch [protected] |
Definition at line 114 of file BaseMessage.h.
string sava::spread::BaseMessage::_sender [protected] |
Definition at line 115 of file BaseMessage.h.