YARP
Yet Another Robot Platform
yarp::os::ElectionOf< PR > Class Template Reference

Pick one of a set of peers to be "active". More...

#include <yarp/os/Election.h>

Public Member Functions

 ElectionOf ()=default
 
virtual ~ElectionOf ()=default
 
PR * add (const std::string &key, typename PR::peer_type *entity)
 
void remove (const std::string &key, typename PR::peer_type *entity)
 
PR::peer_type * getElect (const std::string &key)
 
PR * getRecord (const std::string &key)
 
long getEventCount ()
 
void lock ()
 
void unlock ()
 

Detailed Description

template<class PR>
class yarp::os::ElectionOf< PR >

Pick one of a set of peers to be "active".

Used for situations where a manager is required for some resource used by several peers, but it doesn't matter which peer plays that role.

PR should be a subclass of PeerRecord.

Definition at line 63 of file Election.h.

Constructor & Destructor Documentation

◆ ElectionOf()

template<class PR >
yarp::os::ElectionOf< PR >::ElectionOf ( )
default

◆ ~ElectionOf()

template<class PR >
virtual yarp::os::ElectionOf< PR >::~ElectionOf ( )
virtualdefault

Member Function Documentation

◆ add()

template<class PR >
PR* yarp::os::ElectionOf< PR >::add ( const std::string &  key,
typename PR::peer_type *  entity 
)
inline

Definition at line 91 of file Election.h.

◆ getElect()

template<class PR >
PR::peer_type* yarp::os::ElectionOf< PR >::getElect ( const std::string &  key)
inline

Definition at line 112 of file Election.h.

◆ getEventCount()

template<class PR >
long yarp::os::ElectionOf< PR >::getEventCount ( )
inline

Definition at line 131 of file Election.h.

◆ getRecord()

template<class PR >
PR* yarp::os::ElectionOf< PR >::getRecord ( const std::string &  key)
inline

Definition at line 123 of file Election.h.

◆ lock()

template<class PR >
void yarp::os::ElectionOf< PR >::lock ( )
inline

Definition at line 136 of file Election.h.

◆ remove()

template<class PR >
void yarp::os::ElectionOf< PR >::remove ( const std::string &  key,
typename PR::peer_type *  entity 
)
inline

Definition at line 102 of file Election.h.

◆ unlock()

template<class PR >
void yarp::os::ElectionOf< PR >::unlock ( )
inline

Definition at line 141 of file Election.h.


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