YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
yarp::os::ElectionOf< PR > Class Template Reference

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

#include <yarp/os/Election.h>

+ Inheritance diagram for yarp::os::ElectionOf< PR >:

Public Member Functions

 ElectionOf ()=default
 
virtual ~ElectionOf ()=default
 
PRadd (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)
 
PRgetRecord (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 59 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 87 of file Election.h.

◆ getElect()

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

Definition at line 108 of file Election.h.

◆ getEventCount()

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

Definition at line 127 of file Election.h.

◆ getRecord()

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

Definition at line 119 of file Election.h.

◆ lock()

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

Definition at line 132 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 98 of file Election.h.

◆ unlock()

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

Definition at line 137 of file Election.h.


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