#include <ObjectManager.h>
Public Types | |
typedef std::vector < Object * > | ObjectVector |
typedef ObjectVector::iterator | ObjectVectorItr |
typedef ObjectVector::const_iterator | ObjectVectorConstItr |
typedef coil::Mutex | Mutex |
typedef coil::Guard < coil::Mutex > | Guard |
Public Member Functions | |
ObjectManager () | |
Constructor. | |
~ObjectManager (void) | |
Destructor. | |
bool | registerObject (Object *obj) |
Register the specified object. | |
Object * | unregisterObject (const Identifier &id) |
Unregister the specified object. | |
Object * | find (const Identifier &id) const |
Find the object. | |
std::vector< Object * > | getObjects () const |
Get a list of obejects that are registerd. | |
template<class Pred> | |
Pred | for_each (Pred p) |
Functor for searching object. | |
template<class Pred> | |
Pred | for_each (Pred p) const |
Functor for searching object. | |
Protected Attributes | |
Objects | m_objects |
The list of registered objects. | |
Classes | |
struct | Objects |
The structure for object management. More... |
This is a class for managing various objects.
typedef std::vector<Object*> ObjectManager< Identifier, Object, Predicate >::ObjectVector |
typedef ObjectVector::iterator ObjectManager< Identifier, Object, Predicate >::ObjectVectorItr |
typedef ObjectVector::const_iterator ObjectManager< Identifier, Object, Predicate >::ObjectVectorConstItr |
typedef coil::Mutex ObjectManager< Identifier, Object, Predicate >::Mutex |
typedef coil::Guard<coil::Mutex> ObjectManager< Identifier, Object, Predicate >::Guard |
ObjectManager< Identifier, Object, Predicate >::ObjectManager | ( | ) | [inline] |
Constructor.
Constructor
ObjectManager< Identifier, Object, Predicate >::~ObjectManager | ( | void | ) | [inline] |
Destructor.
Destructor
bool ObjectManager< Identifier, Object, Predicate >::registerObject | ( | Object * | obj | ) | [inline] |
Register the specified object.
Register the object that was specified. If the same object is already registered, this does not anything.
obj | The target object for the registration |
Object* ObjectManager< Identifier, Object, Predicate >::unregisterObject | ( | const Identifier & | id | ) | [inline] |
Unregister the specified object.
Unregister the object that was specified and get it. This operation returns NULL if the specified object is not registered.
id | ID of the target object for the unregistration |
Object* ObjectManager< Identifier, Object, Predicate >::find | ( | const Identifier & | id | ) | const [inline] |
Find the object.
Find the object that matches the specified condition among the registered objects and get it. This operation returns NULL if the object that does matches the specified condition is not registered.
id | ID of the target object for finding |
std::vector<Object*> ObjectManager< Identifier, Object, Predicate >::getObjects | ( | ) | const [inline] |
Get a list of obejects that are registerd.
Get a list of objects that are registerd.
Pred ObjectManager< Identifier, Object, Predicate >::for_each | ( | Pred | p | ) | [inline] |
Functor for searching object.
Pred ObjectManager< Identifier, Object, Predicate >::for_each | ( | Pred | p | ) | const [inline] |
Functor for searching object.
Objects ObjectManager< Identifier, Object, Predicate >::m_objects [protected] |
The list of registered objects.