#include <registry.h>
Public Member Functions | |
bool | add (UUID uuid, RegistrantWPtr registrant) |
RegistrantPtr | get (UUID uuid) |
bool | remove (UUID uuid, RegistrantWPtr registrant) |
Private Types | |
typedef boost::unordered_map < UUID, RegistrantWPtr > | MapType |
Private Attributes | |
MapType | id_to_registrant_map_ |
Registry stores a mapping from UUIDs to Registrants. Can be used to look up the UUID of a SingleSceneObject and return an object responsible for it.
Internally stores boost::weak_ptr to the registrants, so it will not keep registrants alive which were otherwise lost.
Definition at line 46 of file registry.h.
typedef boost::unordered_map<UUID, RegistrantWPtr> rve_common::Registry::MapType [private] |
Definition at line 65 of file registry.h.
bool rve_common::Registry::add | ( | UUID | uuid, |
RegistrantWPtr | registrant | ||
) |
RegistrantPtr rve_common::Registry::get | ( | UUID | uuid | ) |
Return a shared_ptr to the registrant previously stored for a UUID. Returns an empty shared_ptr if nothing was registered for this UUID or if the registrant has been destroyed.
Definition at line 60 of file registry.cpp.
bool rve_common::Registry::remove | ( | UUID | uuid, |
RegistrantWPtr | registrant | ||
) |
Unregister something with a given UUID. Returns false if the UUID was not previously registered with this registrant, true if it was.
Definition at line 49 of file registry.cpp.
Definition at line 66 of file registry.h.