|
FOX/ObjCryst++
2022
|
Object Registry. More...
Inheritance diagram for ObjCryst::ObjRegistry< T >:
Collaboration diagram for ObjCryst::ObjRegistry< T >:Public Member Functions | |
| ObjRegistry (const string &name) | |
| 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. More... | |
| const T & | GetObj (const unsigned int i) const |
| Get object #i in the registry. More... | |
| T & | GetObj (const string &objName) |
| Get an object from its name in the registry. More... | |
| const T & | GetObj (const string &objName) const |
| Get an object from its name in the registry. More... | |
| T & | GetObj (const string &objName, const string &className) |
| Get an object from its name in the registry. More... | |
| const T & | GetObj (const string &objName, const string &className) const |
| Get an object from its name in the registry. More... | |
| 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. | |
| void | Print () const |
| void | SetName (const string &) |
| const string & | GetName () const |
| 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. More... | |
| long | Find (const T &obj) const |
| Find the number of an object in the registry The search starts at the end of the registry. | |
| long | Find (const T *pobj) 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. | |
| void | AutoUpdateUI (const bool autoup=true) |
| Enable the UI automatic update, so that objects in the registry are automatically added to the UI. | |
| void | UpdateUI () |
| Manually update the UI, making sure all objects in the registry are displayed This is useful when the automatic adding of objects has been disabled. | |
| std::size_t | size () const |
| STL access to object size. | |
| vector< T * >::const_iterator | begin () const |
| low-level access to the underlying vector begin(). More... | |
| vector< T * >::const_iterator | end () const |
| low-level access to the underlying vector end(). More... | |
| std::list< T * >::const_iterator | list_begin () const |
| low-level access to the underlying list begin(). More... | |
| std::list< T * >::const_iterator | list_end () const |
| low-level access to the underlying list end(). More... | |
Private Attributes | |
| vector< T * > | mvpRegistry |
| The registry of objects. | |
| std::list< T * > | mvpRegistryList |
| Another view of the registry of objects - this time as a std::list, which will not be invalidated if one object is deleted. | |
| string | mName |
| Name of this registry. | |
| RefinableObjClock | mListClock |
| Last time an object was added or removed. | |
| bool | mAutoUpdateUI |
| Enable the user interface update. More... | |
Object Registry.
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.
Definition at line 644 of file RefinableObj.h.
| vector< T * >::const_iterator ObjCryst::ObjRegistry< T >::begin |
low-level access to the underlying vector begin().
Const access as we do not want the number and order of objects to change, but the objects themselves can be modified.
Definition at line 1138 of file RefinableObj.cpp.
| vector< T * >::const_iterator ObjCryst::ObjRegistry< T >::end |
low-level access to the underlying vector end().
Const access as we do not want the number and order of objects to change, but the objects themselves can be modified.
Definition at line 1143 of file RefinableObj.cpp.
| long ObjCryst::ObjRegistry< T >::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.
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)
Definition at line 1071 of file RefinableObj.cpp.
| T & ObjCryst::ObjRegistry< T >::GetObj | ( | const string & | objName | ) |
Get an object from its name in the registry.
The search starts at the end of the registry.
Definition at line 1008 of file RefinableObj.cpp.
| const T & ObjCryst::ObjRegistry< T >::GetObj | ( | const string & | objName | ) | const |
Get an object from its name in the registry.
The search starts at the end of the registry.
Definition at line 1014 of file RefinableObj.cpp.
| T & ObjCryst::ObjRegistry< T >::GetObj | ( | const string & | objName, |
| const string & | className | ||
| ) |
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.
Definition at line 1020 of file RefinableObj.cpp.
| const T & ObjCryst::ObjRegistry< T >::GetObj | ( | const string & | objName, |
| const string & | className | ||
| ) | const |
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.
Definition at line 1027 of file RefinableObj.cpp.
| T & ObjCryst::ObjRegistry< T >::GetObj | ( | const unsigned int | i | ) |
Get object #i in the registry.
Use with caution. The order of the objects changes as objects are added and removed.
Definition at line 996 of file RefinableObj.cpp.
| const T & ObjCryst::ObjRegistry< T >::GetObj | ( | const unsigned int | i | ) | const |
Get object #i in the registry.
Use with caution. The order of the objects changes as objects are added and removed.
Definition at line 1002 of file RefinableObj.cpp.
| list< T * >::const_iterator ObjCryst::ObjRegistry< T >::list_begin |
low-level access to the underlying list begin().
Const access as we do not want the number and order of objects to change, but the objects themselves can be modified. This iterator should remain valid even if an object is removed.
Definition at line 1148 of file RefinableObj.cpp.
| list< T * >::const_iterator ObjCryst::ObjRegistry< T >::list_end |
low-level access to the underlying list end().
Const access as we do not want the number and order of objects to change, but the objects themselves can be modified. This iterator should remain valid even if an object is removed.
Definition at line 1153 of file RefinableObj.cpp.
|
private |
Enable the user interface update.
If true, any time an object is added, it will be added to the user interface (wx...). If objects have not been added to the user interface, this can be done asynchronously using UpdateUI() which will go through the list of objects and add those not yet displayed.
This does not affect the removal of objects.
Definition at line 763 of file RefinableObj.h.