All instances of the Observer class are assigned an ID and registered within this class.
More...
#include <carma/util/ObserverRegistry.h>
All instances of the Observer class are assigned an ID and registered within this class.
An Observable can then see if an Observer registered with it still exists. The constructor/destructor of Observer will take care of registering with this singleton class.
Definition at line 38 of file ObserverRegistry.h.
virtual carma::util::ObserverRegistry::~ObserverRegistry |
( |
| ) |
|
|
virtual |
int carma::util::ObserverRegistry::getNumObservers |
( |
| ) |
|
Get the number of registered observers.
There is no test for uniqueness; if a single object is registered multiple times it will be counted multiple times.
Return singleton instance.
bool carma::util::ObserverRegistry::isRegistered |
( |
int |
regID | ) |
|
See if an id is registered.
- Parameters
-
void carma::util::ObserverRegistry::lock |
( |
| ) |
|
int carma::util::ObserverRegistry::registerObserver |
( |
| ) |
|
Register objects to be notified when event occurs.
- Parameters
-
observer | Object to notify when event occurs |
- Returns
- registerationId that can be used to unregister
std::vector<int> carma::util::ObserverRegistry::registryIds |
( |
| ) |
|
Put all regIDs into a vector.
std::string carma::util::ObserverRegistry::registryToString |
( |
| ) |
|
Put all regIDs into a single line string.
void carma::util::ObserverRegistry::unlock |
( |
| ) |
|
void carma::util::ObserverRegistry::unregisterObserver |
( |
int |
registrationId | ) |
|
Unregister objects to be notified when event occurs.
- Parameters
-
- Exceptions
-
The documentation for this class was generated from the following file: