10 #ifndef YARP_OS_ELECTION_H
11 #define YARP_OS_ELECTION_H
66 typedef void* voidPtr;
70 typedef typename std::map<std::string, PR> map_type;
74 PR* getRecordRaw(
const std::string& key,
bool create =
false)
76 typename map_type::iterator entry = nameMap.find(key);
77 if (entry == nameMap.end() && create) {
79 entry = nameMap.find(key);
81 if (entry == nameMap.end()) {
84 return &(entry->second);
91 PR*
add(
const std::string& key,
typename PR::peer_type* entity)
95 PR* rec = getRecordRaw(key,
true);
102 void remove(
const std::string& key,
typename PR::peer_type* entity)
106 PR* rec = getRecordRaw(key,
false);
112 typename PR::peer_type*
getElect(
const std::string& key)
115 PR* rec = getRecordRaw(key,
false);
118 return rec->getFirst();
126 PR* rec = getRecordRaw(key,
false);
150 #endif // YARP_OS_ELECTION_H