Public Member Functions | Private Types | Private Attributes
rve_common::Registry Class Reference

#include <registry.h>

List of all members.

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_

Detailed Description

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.


Member Typedef Documentation

typedef boost::unordered_map<UUID, RegistrantWPtr> rve_common::Registry::MapType [private]

Definition at line 65 of file registry.h.


Member Function Documentation

bool rve_common::Registry::add ( UUID  uuid,
RegistrantWPtr  registrant 
)

Register something with a given UUID. Registry only supports a single entry for each UUID, so this returns false and does nothing if the UUID is already registered. Returns true on success.

Definition at line 35 of file registry.cpp.

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.


Member Data Documentation

Definition at line 66 of file registry.h.


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


rve_common
Author(s): Josh Faust
autogenerated on Wed Dec 11 2013 14:30:49