22 #ifdef LIBSSRCSPREAD_ENABLE_MEMBERSHIP_INFO
31 void BaseMessage::get_vs_set_members(
const Spread::vs_set_info *vs_set,
33 unsigned int offset)
const
37 members->resize(members->capacity());
41 sp_get_vs_set_members(vs_set, members->groups() + offset,
42 members->
size() - offset);
45 result = vs_set->num_members;
47 members->resize(offset + result);
50 members->resize(offset);
52 members->resize(offset + result);
54 members->resize(offset);
70 void BaseMessage::get_membership_info(MembershipInfo & info)
const
71 SSRC_DECL_THROW(
Error)
73 int result = sp_get_membership_info(&info._info);
80 get_vs_set_members(&info._info.my_vs_set, &info._local_members);
82 if(info._info.num_vs_sets > 0) {
83 detail::Buffer<Spread::vs_set_info> vs_sets(info._info.num_vs_sets);
84 unsigned int index = 0;
86 vs_sets.resize(info._info.num_vs_sets);
87 result = sp_get_vs_sets_info(&vs_sets[0], vs_sets.size(), &index);
92 if(static_cast<unsigned int>(result) != vs_sets.size())
93 vs_sets.resize(result);
95 info._non_local_members.clear();
97 for(
int i = 0; i <
result; ++i) {
98 if(static_cast<unsigned int>(i) != index)
99 get_vs_set_members(&vs_sets[i], &info._non_local_members,
100 info._non_local_members.size());