2 #ifndef CARMA_UTIL_OBSERVERREGISTRY_H
3 #define CARMA_UTIL_OBSERVERREGISTRY_H
23 #include "carma/util/PthreadMutex.h"
104 std::vector<int> registry_;
105 int nextRegistrationId_;
114 #endif // CARMA_UTIL_OBSERVERREGISTRY_H
int registerObserver()
Register objects to be notified when event occurs.
All instances of the Observer class are assigned an ID and registered within this class...
void unlock()
Unlock the registry.
std::vector< int > registryIds()
Put all regIDs into a vector.
int getNumObservers()
Get the number of registered observers.
virtual ~ObserverRegistry()
Destructor.
void lock()
Lock the registry.
void unregisterObserver(int registrationId)
Unregister objects to be notified when event occurs.
static ObserverRegistry & instance()
Return singleton instance.
A simple wrapper class that makes use of ::pthread_mutex_t easier in a C++ world. ...
bool isRegistered(int regID)
See if an id is registered.
std::string registryToString()
Put all regIDs into a single line string.