Public Methods | |
void | Register (T &obj) |
Register a new object. Already registered objects are skipped. | |
void | DeRegister (T &obj) |
De-register an object. | |
void | DeRegister (const string &objName) |
De-register an object from its name. | |
void | DeRegisterAll () |
De-register all objects from the list. | |
void | DeleteAll () |
Delete all objects in the registry.. Use with caution !! | |
T & | GetObj (const unsigned int i) |
Get object i in the registry. | |
const T & | GetObj (const unsigned int i) const |
Get object i in the registry. | |
T & | GetObj (const string &objName) |
Get an object from its name in the registry. | |
const T & | GetObj (const string &objName) const |
Get an object from its name in the registry. | |
T & | GetObj (const string &objName, const string &className) |
Get an object from its name in the registry. | |
const T & | GetObj (const string &objName, const string &className) const |
Get an object from its name in the registry. | |
long | GetNb () const |
Get the index of an object in the registry, from its name Warning: it can change if an object is removed from the registry. | |
long | Find (const string &objName) const |
Find the number of an object in the registry from its name (slow !) The search starts at the *end* of the registry. | |
long | Find (const string &objName, const string &className, const bool nothrow=false) const |
Find the number of an object in the registry from its name (slow !) The search starts at the *end* of the registry. | |
long | Find (const T &obj) const |
Find the number of an object in the registry The search starts at the *end* of the registry. | |
const RefinableObjClock & | GetRegistryClock () const |
Last time an object was added or removed from the registry. | |
Private Attributes | |
vector< T * > | mvpRegistry |
The registry of objects. | |
string | mName |
Name of this registry. | |
RefinableObjClock | mListClock |
Last time an object was added or removed. |
This class is used to keep a list of all object of a given class at the global level, or inside another object. This is primarily aimed for the derivative of the RefinableObj class but it can be used for any class that has GetName() and GetClassName() function. This class now uses a vector<> approach from the STL.
|
Find the number of an object in the registry from its name (slow !) The search starts at the *end* of the registry. Also check the class of the object (inheritance...). use nothrow=true to avoid having an exception thrown if no object is found (instead the index returned will be -1) |
|
Get an object from its name in the registry. The search starts at the *end* of the registry. Also check the class of the object. |
|
Get an object from its name in the registry. The search starts at the *end* of the registry. Also check the class of the object. |
|
Get an object from its name in the registry. The search starts at the *end* of the registry. |
|
Get an object from its name in the registry. The search starts at the *end* of the registry. |
|
Get object i in the registry.
For internal use only. Use with caution. The order of the objects changes as objects are added and removed. |
|
Get object i in the registry.
For internal use only. Use with caution. The order of the objects changes as objects are added and removed. |