MeVisLab Toolbox Reference
|
Database (object container) - manages all objects. More...
#include <ObjMgr/mlObjMgrObjectContainer.h>
Public Types | |
typedef objVec::iterator | iterator |
typedef objVec::const_iterator | const_iterator |
Public Types inherited from ml::Base | |
enum | PersistenceInterface { PersistenceByString , PersistenceByTreeNode , PersistenceByStream } |
This enum describes the different persistence interfaces available. More... | |
Public Member Functions | |
omObjectContainer (ObjMgr *objMgr) | |
omObjectContainer () | |
~omObjectContainer () override | |
omIDType | generateID (MLuint32 minID=0, MLuint32 maxID=omID_MAX, const std::string &prefix="") const |
Generate unique object ID. A prefix may be given in the prefix argument. No object is actually created. More... | |
omObject & | createObject (MLuint32 minID=0, MLuint32 maxID=omID_MAX, const std::string &prefix="") |
Creates and inserts object in the container. More... | |
bool | assignNewObjectID (const omIDType &oldKey, const omIDType &newKey) |
Assign a new ID to an existing object. More... | |
omObject & | operator[] (const omIDType &key) |
Writable access operator to individual objects. More... | |
const omObject & | operator[] (const omIDType &key) const |
Read only access operator to individual objects. More... | |
omObject & | getObject (const omIDType &key) |
Writable access operator to individual objects. More... | |
omObject & | insert (const omObject &obj, MLuint32 minID=0, MLuint32 maxID=omID_MAX) |
Insert object instance into container. More... | |
const omObject & | insertConst (const omObject &obj, MLuint32 minID=0, MLuint32 maxID=omID_MAX) |
Insert object instance into container. More... | |
bool | exists (const omIDType &key) const |
True if object with given key exists. More... | |
void | erase (const omIDType &key) |
Erase the object whose key is given. More... | |
void | clear () |
Remove all objects from container. More... | |
size_t | size () const |
Get number of objects in container. More... | |
bool | empty () const |
True if container is empty. More... | |
objVec::iterator | begin () |
Returns a iterator pointing to the beginning of the object container. More... | |
objVec::iterator | end () |
Returns a iterator pointing to the end of the object container. More... | |
objVec::const_iterator | begin () const |
Returns a const_iterator pointing to the beginning of the object container. More... | |
objVec::const_iterator | end () const |
Returns a const_iterator pointing to the end of the object container. More... | |
ObjMgr * | getObjMgr () |
Get access to ObjMgr instance. More... | |
Public Member Functions inherited from ml::Base | |
Base () | |
Constructor. More... | |
virtual | ~Base () |
Destructor. More... | |
virtual Base * | deepCopy () const |
Set addStateToTree version number that can be accessed via getAddStateVersion() More... | |
bool | isOfAllowedType (const std::vector< const RuntimeType * > &types) const |
Check if this object's type is equal to or derived from one of the types given in the argument. More... | |
virtual bool | isRefCountedBase () const |
Returns if the instance is derived from RefCountedBase. More... | |
virtual std::string | detailString () const |
Return a string describing this object. More... | |
virtual bool | implementsPersistence (PersistenceInterface) const |
Override this method to declare which persistence interfaces are implemented by your derived class. More... | |
virtual std::string | persistentState () const |
Returns a string describing the object's internal state. More... | |
virtual void | setPersistentState (const std::string &state) |
Restores the object's internal state from a string that had been previously generated using persistentState() . More... | |
virtual void | addStateToTree (TreeNode *) const |
Attaches the object state as children of the given parent node. More... | |
virtual void | readStateFromTree (TreeNode *) |
Reads the object state from the children of the given parent node. More... | |
virtual void | writeTo (AbstractPersistenceOutputStream *) const |
Write the objects state to the data stream object. More... | |
virtual void | readFrom (AbstractPersistenceInputStream *, int) |
Read the objects state from the data stream object. More... | |
Protected Attributes | |
ObjMgr * | _objMgr |
Macro for declaring methods for the runtime system. More... | |
Friends | |
class | ObjMgr |
Additional Inherited Members | |
Protected Member Functions inherited from ml::Base | |
virtual char * | getPersistentState () const |
Returns a C string describing the object's internal state. More... | |
virtual void | setPersistentState (const char *) |
Restores the object's internal state from a string that had been previously generated using getPersistentState() . More... | |
virtual void | clearPersistentState (char *) const |
Disposes a string previously allocated by getPersistentState() . More... | |
Database (object container) - manages all objects.
Definition at line 32 of file mlObjMgrObjectContainer.h.
typedef objVec::const_iterator ml::omObjectContainer::const_iterator |
Definition at line 50 of file mlObjMgrObjectContainer.h.
typedef objVec::iterator ml::omObjectContainer::iterator |
Definition at line 49 of file mlObjMgrObjectContainer.h.
ml::omObjectContainer::omObjectContainer | ( | ObjMgr * | objMgr | ) |
ml::omObjectContainer::omObjectContainer | ( | ) |
|
override |
Assign a new ID to an existing object.
The new key must not exist in the objects container. Returns 'true' on success, 'false' otherwise.
|
inline |
Returns a iterator pointing to the beginning of the object container.
Definition at line 109 of file mlObjMgrObjectContainer.h.
|
inline |
Returns a const_iterator pointing to the beginning of the object container.
Definition at line 118 of file mlObjMgrObjectContainer.h.
void ml::omObjectContainer::clear | ( | ) |
Remove all objects from container.
omObject& ml::omObjectContainer::createObject | ( | MLuint32 | minID = 0 , |
MLuint32 | maxID = omID_MAX , |
||
const std::string & | prefix = "" |
||
) |
Creates and inserts object in the container.
The numerical object ID is generated in the given range. A prefix may be given in the prefix argument.
|
inline |
True if container is empty.
Definition at line 104 of file mlObjMgrObjectContainer.h.
|
inline |
Returns a iterator pointing to the end of the object container.
Definition at line 113 of file mlObjMgrObjectContainer.h.
|
inline |
Returns a const_iterator pointing to the end of the object container.
Definition at line 122 of file mlObjMgrObjectContainer.h.
void ml::omObjectContainer::erase | ( | const omIDType & | key | ) |
Erase the object whose key is given.
|
inline |
True if object with given key exists.
Definition at line 88 of file mlObjMgrObjectContainer.h.
omIDType ml::omObjectContainer::generateID | ( | MLuint32 | minID = 0 , |
MLuint32 | maxID = omID_MAX , |
||
const std::string & | prefix = "" |
||
) | const |
Generate unique object ID. A prefix may be given in the prefix argument. No object is actually created.
Writable access operator to individual objects.
No object is created if it does not exist. Instead an invalid object is returned (Check with isValid()).
|
inline |
Get access to ObjMgr instance.
Definition at line 127 of file mlObjMgrObjectContainer.h.
omObject& ml::omObjectContainer::insert | ( | const omObject & | obj, |
MLuint32 | minID = 0 , |
||
MLuint32 | maxID = omID_MAX |
||
) |
Insert object instance into container.
The numerical object ID is generated in the given range. The function returns a writable reference to the object in the container.
const omObject& ml::omObjectContainer::insertConst | ( | const omObject & | obj, |
MLuint32 | minID = 0 , |
||
MLuint32 | maxID = omID_MAX |
||
) |
Insert object instance into container.
The numerical object ID is generated in the given range. The function returns a read-only reference to the object in the container.
Writable access operator to individual objects.
If the object does not exist it is created. Object information can be read and written.
Read only access operator to individual objects.
No object is created if it does not exist. Instead an invalid object is returned (Check with isValid()). Object information can only be read.
|
inline |
Get number of objects in container.
Definition at line 99 of file mlObjMgrObjectContainer.h.
|
friend |
Definition at line 34 of file mlObjMgrObjectContainer.h.
|
protected |
Macro for declaring methods for the runtime system.
Pointer to ObjMgr object.
Definition at line 45 of file mlObjMgrObjectContainer.h.