ssrc::spread::MembershipInfo Class Reference
MembershipInfo stores information about group membership messages. More...
#include <MembershipInfo.h>
Public Member Functions | |
| BaseMessage::service_type | service () const |
| Returns the service type of the message. | |
| void | get_local_members (GroupList &members) const |
| Returns a list of the private group names from the local segment that remained in the group after a change in membership caused by a network partition. | |
| void | get_non_local_members (GroupList &members) const |
| Returns a list of the private group names from all the segments except the local segment that belong to the group after a change in membership caused by a network partition. | |
| void | get_all_members (GroupList &members) const |
| Returns a list of the private group names from all the segments that belong to the group after a change in membership caused by a network partition. | |
| bool | equal_group_ids (const MembershipInfo &info) const |
| Tests if the group ids of the MembrshipInfo objects are the same. | |
| string | changed_member () const |
| Returns the private group name of member who joined, left, or disconnected. | |
| bool | is_regular_membership () const |
| Returns true if the message is a regular membership message, false if not. | |
| bool | is_transition () const |
| Returns true if the message is a transitional membership message, false if not. | |
| bool | is_self_leave () const |
| Returns true if the message is a self-leave membership message, false if not. | |
| bool | caused_by_join () const |
| Returns true if the membership message was caused by a group join, false if not. | |
| bool | caused_by_leave () const |
| Returns true if the membership message was caused by a group leave, false if not. | |
| bool | caused_by_disconnect () const |
| Returns true if the membership message was caused by a client disconnect, false if not. | |
| bool | caused_by_network () const |
| Returns true if the membership message was caused by a network partition, false if not. | |
Friends | |
| void | BaseMessage::get_membership_info (MembershipInfo &info) const |
Detailed Description
MembershipInfo stores information about group membership messages.
You can populate a MembershipInfo instance with information about a membership message by invoking BaseMessage::get_membership_info on a Message or ScatterMessage containing a membership message.
Warning: This class is available only when compiled against Spread 4.x and greater.
Definition at line 41 of file MembershipInfo.h.
Member Function Documentation
| bool ssrc::spread::MembershipInfo::caused_by_disconnect | ( | ) | const [inline] |
Returns true if the membership message was caused by a client disconnect, false if not.
- Returns:
- true if the membership message was caused by a client disconnect, false if not.
Definition at line 183 of file MembershipInfo.h.
| bool ssrc::spread::MembershipInfo::caused_by_join | ( | ) | const [inline] |
Returns true if the membership message was caused by a group join, false if not.
- Returns:
- true if the membership message was caused by a group join, false if not.
Definition at line 163 of file MembershipInfo.h.
| bool ssrc::spread::MembershipInfo::caused_by_leave | ( | ) | const [inline] |
Returns true if the membership message was caused by a group leave, false if not.
- Returns:
- true if the membership message was caused by a group leave, false if not.
Definition at line 173 of file MembershipInfo.h.
| bool ssrc::spread::MembershipInfo::caused_by_network | ( | ) | const [inline] |
Returns true if the membership message was caused by a network partition, false if not.
- Returns:
- true if the membership message was caused by a network partition, false if not.
Definition at line 193 of file MembershipInfo.h.
| string ssrc::spread::MembershipInfo::changed_member | ( | ) | const [inline] |
Returns the private group name of member who joined, left, or disconnected.
Only valid if caused_by_join, leave, or disconnect are true.
- Returns:
- The private group name of member who joined, left, or disconnected.
Definition at line 125 of file MembershipInfo.h.
| bool ssrc::spread::MembershipInfo::equal_group_ids | ( | const MembershipInfo & | info | ) | const [inline] |
Tests if the group ids of the MembrshipInfo objects are the same.
- Parameters:
-
info The MembershipInfo object whose group id is to to compare.
- Returns:
- true if the group ids are equal, false if not.
Definition at line 114 of file MembershipInfo.h.
| void ssrc::spread::MembershipInfo::get_all_members | ( | GroupList & | members | ) | const [inline] |
Returns a list of the private group names from all the segments that belong to the group after a change in membership caused by a network partition.
For join/leave/disconnect changes, the list contains only the changed member (you should call changed_member() instead). This is the equivalent of the group information from the C API vs_set_info data structure, but the group ordering may differ.
- Parameters:
-
members A reference to the GroupList that should store all of the members.
Definition at line 102 of file MembershipInfo.h.
References ssrc::spread::GroupList::add(), and ssrc::spread::GroupList::clear().
| void ssrc::spread::MembershipInfo::get_local_members | ( | GroupList & | members | ) | const [inline] |
Returns a list of the private group names from the local segment that remained in the group after a change in membership caused by a network partition.
For join/leave/disconnect changes, the list contains only the changed member (you should call changed_member() instead). This is the equivalent of the group information from the my_vs_set vs_set_info member from the membership_info struct in the C API.
- Parameters:
-
members A reference to the GroupList that should store the local members.
Definition at line 74 of file MembershipInfo.h.
| void ssrc::spread::MembershipInfo::get_non_local_members | ( | GroupList & | members | ) | const [inline] |
Returns a list of the private group names from all the segments except the local segment that belong to the group after a change in membership caused by a network partition.
For join/leave/disconnect changes, the list will be empty.
- Parameters:
-
members A reference to the GroupList that should store the non-local members.
Definition at line 86 of file MembershipInfo.h.
| bool ssrc::spread::MembershipInfo::is_regular_membership | ( | ) | const [inline] |
Returns true if the message is a regular membership message, false if not.
- Returns:
- true if the message is a regular membership message, false if not.
Definition at line 133 of file MembershipInfo.h.
| bool ssrc::spread::MembershipInfo::is_self_leave | ( | ) | const [inline] |
Returns true if the message is a self-leave membership message, false if not.
- Returns:
- true if the message is a self-leave membership message, false if not.
Definition at line 153 of file MembershipInfo.h.
| bool ssrc::spread::MembershipInfo::is_transition | ( | ) | const [inline] |
Returns true if the message is a transitional membership message, false if not.
- Returns:
- true if the message is a transitional membership message, false if not.
Definition at line 143 of file MembershipInfo.h.
| BaseMessage::service_type ssrc::spread::MembershipInfo::service | ( | ) | const [inline] |
Returns the service type of the message.
- Returns:
- The service type of the message.
Definition at line 58 of file MembershipInfo.h.
Friends And Related Function Documentation
| void BaseMessage::get_membership_info | ( | MembershipInfo & | info | ) | const [friend] |
The documentation for this class was generated from the following file: