RSB  0.7.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rsb::spread::MembershipManager Class Reference

Reference counting class for Spread group memberships. More...

#include <MembershipManager.h>

Collaboration diagram for rsb::spread::MembershipManager:
Collaboration graph

Public Member Functions

 MembershipManager ()
virtual ~MembershipManager ()
void join (std::string group, SpreadConnectionPtr s)
 Joins the given Spread group if not previously done and increments reference count for this group by one.
void leave (std::string group, SpreadConnectionPtr s)
 Decrements the reference count for the given Spread group identifier.

Private Attributes

rsc::logging::LoggerPtr logger
boost::recursive_mutex groupsMutex
boost::shared_ptr< GroupMapgroups

Detailed Description

Reference counting class for Spread group memberships.

Author
swrede
Todo:
think about adding SpreadConnectionPtr as a member, offering methods that operate on this connection only

Definition at line 54 of file MembershipManager.h.

Constructor & Destructor Documentation

rsb::spread::MembershipManager::MembershipManager ( )

Definition at line 37 of file MembershipManager.cpp.

References groups, and logger.

rsb::spread::MembershipManager::~MembershipManager ( )
virtual

Definition at line 43 of file MembershipManager.cpp.

Member Function Documentation

void rsb::spread::MembershipManager::join ( std::string  group,
SpreadConnectionPtr  s 
)

Joins the given Spread group if not previously done and increments reference count for this group by one.

Parameters
groupgroup name to join
sspread connection to join on

Definition at line 46 of file MembershipManager.cpp.

References groups, groupsMutex, and logger.

void rsb::spread::MembershipManager::leave ( std::string  group,
SpreadConnectionPtr  s 
)

Decrements the reference count for the given Spread group identifier.

If reference count for this identifier drops to zero, the corresponding Spread group is left.

Parameters
groupgroup name to leave
sspread connection to leave on

Definition at line 69 of file MembershipManager.cpp.

References groups, groupsMutex, and logger.

Member Data Documentation

boost::shared_ptr<GroupMap> rsb::spread::MembershipManager::groups
private

Definition at line 81 of file MembershipManager.h.

Referenced by join(), leave(), and MembershipManager().

boost::recursive_mutex rsb::spread::MembershipManager::groupsMutex
private

Definition at line 80 of file MembershipManager.h.

Referenced by join(), and leave().

rsc::logging::LoggerPtr rsb::spread::MembershipManager::logger
private

Definition at line 79 of file MembershipManager.h.

Referenced by join(), leave(), and MembershipManager().


The documentation for this class was generated from the following files: