OpenRTM-aist 2.0.2
|
Class for managing objects. More...
#include <ObjectManager.h>
Classes | |
struct | Objects |
The structure for object management . More... | |
Public Types | |
using | ObjectVector = std::vector<Object*> |
using | ObjectVectorItr = typename ObjectVector::iterator |
using | ObjectVectorConstItr = typename ObjectVector::const_iterator |
Public Member Functions | |
ObjectManager ()=default | |
Constructor. | |
~ObjectManager ()=default | |
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 . | |
Class for managing objects.
This is a class for managing various objects.
using ObjectManager< Identifier, Object, Predicate >::ObjectVector = std::vector<Object*> |
using ObjectManager< Identifier, Object, Predicate >::ObjectVectorConstItr = typename ObjectVector::const_iterator |
using ObjectManager< Identifier, Object, Predicate >::ObjectVectorItr = typename ObjectVector::iterator |
|
default |
Constructor.
Constructor
|
default |
Destructor.
Destructor
|
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 |
References ObjectManager< Identifier, Object, Predicate >::Objects::_mutex, ObjectManager< Identifier, Object, Predicate >::Objects::_obj, and ObjectManager< Identifier, Object, Predicate >::m_objects.
|
inline |
Functor for searching object .
References ObjectManager< Identifier, Object, Predicate >::Objects::_mutex, ObjectManager< Identifier, Object, Predicate >::Objects::_obj, and ObjectManager< Identifier, Object, Predicate >::m_objects.
|
inline |
Functor for searching object .
References ObjectManager< Identifier, Object, Predicate >::Objects::_mutex, ObjectManager< Identifier, Object, Predicate >::Objects::_obj, and ObjectManager< Identifier, Object, Predicate >::m_objects.
|
inline |
Get a list of obejects that are registerd.
Get a list of objects that are registerd.
References ObjectManager< Identifier, Object, Predicate >::Objects::_mutex, ObjectManager< Identifier, Object, Predicate >::Objects::_obj, and ObjectManager< Identifier, Object, Predicate >::m_objects.
|
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 |
References ObjectManager< Identifier, Object, Predicate >::Objects::_mutex, ObjectManager< Identifier, Object, Predicate >::Objects::_obj, and ObjectManager< Identifier, Object, Predicate >::m_objects.
|
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 |
References ObjectManager< Identifier, Object, Predicate >::Objects::_mutex, ObjectManager< Identifier, Object, Predicate >::Objects::_obj, and ObjectManager< Identifier, Object, Predicate >::m_objects.
|
protected |
The list of registered objects .
Referenced by ObjectManager< Identifier, Object, Predicate >::find(), ObjectManager< Identifier, Object, Predicate >::for_each(), ObjectManager< Identifier, Object, Predicate >::for_each(), ObjectManager< Identifier, Object, Predicate >::getObjects(), ObjectManager< Identifier, Object, Predicate >::registerObject(), and ObjectManager< Identifier, Object, Predicate >::unregisterObject().