#include <MembershipInfo.h>
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 42 of file 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 |
| BaseMessage::service_type sava::spread::MembershipInfo::service | ( | ) | const [inline] |
Returns the service type of the message.
Definition at line 59 of file MembershipInfo.h.
| void sava::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.
| members | A reference to the GroupList that should store the local members. |
Definition at line 75 of file MembershipInfo.h.
| void sava::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.
| members | A reference to the GroupList that should store the non-local members. |
Definition at line 87 of file MembershipInfo.h.
| void sava::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.
| members | A reference to the GroupList that should store all of the members. |
Definition at line 103 of file MembershipInfo.h.
References sava::spread::GroupList::add(), and sava::spread::GroupList::clear().
| bool sava::spread::MembershipInfo::equal_group_ids | ( | const MembershipInfo & | info | ) | const [inline] |
Tests if the group ids of the MembrshipInfo objects are the same.
| info | The MembershipInfo object whose group id is to to compare. |
Definition at line 115 of file MembershipInfo.h.
References _info.
| string sava::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.
Definition at line 126 of file MembershipInfo.h.
| bool sava::spread::MembershipInfo::is_regular_membership | ( | ) | const [inline] |
Returns true if the message is a regular membership message, false if not.
Definition at line 134 of file MembershipInfo.h.
| bool sava::spread::MembershipInfo::is_transition | ( | ) | const [inline] |
Returns true if the message is a transitional membership message, false if not.
Definition at line 144 of file MembershipInfo.h.
| bool sava::spread::MembershipInfo::is_self_leave | ( | ) | const [inline] |
Returns true if the message is a self-leave membership message, false if not.
Definition at line 154 of file MembershipInfo.h.
| bool sava::spread::MembershipInfo::caused_by_join | ( | ) | const [inline] |
Returns true if the membership message was caused by a group join, false if not.
Definition at line 164 of file MembershipInfo.h.
| bool sava::spread::MembershipInfo::caused_by_leave | ( | ) | const [inline] |
Returns true if the membership message was caused by a group leave, false if not.
Definition at line 174 of file MembershipInfo.h.
| bool sava::spread::MembershipInfo::caused_by_disconnect | ( | ) | const [inline] |
Returns true if the membership message was caused by a client disconnect, false if not.
Definition at line 184 of file MembershipInfo.h.
| bool sava::spread::MembershipInfo::caused_by_network | ( | ) | const [inline] |
Returns true if the membership message was caused by a network partition, false if not.
Definition at line 194 of file MembershipInfo.h.
| void BaseMessage::get_membership_info | ( | MembershipInfo & | info | ) | const [friend] |