MeVisLab Toolbox Reference
ml::omObjectContainer Class Reference

Database (object container) - manages all objects. More...

#include <ObjMgr/mlObjMgrObjectContainer.h>

Inheritance diagram for ml::omObjectContainer:
ml::Base

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...
 
omObjectcreateObject (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...
 
omObjectoperator[] (const omIDType &key)
 Writable access operator to individual objects. More...
 
const omObjectoperator[] (const omIDType &key) const
 Read only access operator to individual objects. More...
 
omObjectgetObject (const omIDType &key)
 Writable access operator to individual objects. More...
 
omObjectinsert (const omObject &obj, MLuint32 minID=0, MLuint32 maxID=omID_MAX)
 Insert object instance into container. More...
 
const omObjectinsertConst (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...
 
ObjMgrgetObjMgr ()
 Get access to ObjMgr instance. More...
 
- Public Member Functions inherited from ml::Base
 Base ()
 Constructor. More...
 
virtual ~Base ()
 Destructor. More...
 
virtual BasedeepCopy () 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...
 

Detailed Description

Database (object container) - manages all objects.

Definition at line 32 of file mlObjMgrObjectContainer.h.

Member Typedef Documentation

◆ const_iterator

typedef objVec::const_iterator ml::omObjectContainer::const_iterator

Definition at line 50 of file mlObjMgrObjectContainer.h.

◆ iterator

typedef objVec::iterator ml::omObjectContainer::iterator

Definition at line 49 of file mlObjMgrObjectContainer.h.

Constructor & Destructor Documentation

◆ omObjectContainer() [1/2]

ml::omObjectContainer::omObjectContainer ( ObjMgr objMgr)

◆ omObjectContainer() [2/2]

ml::omObjectContainer::omObjectContainer ( )

◆ ~omObjectContainer()

ml::omObjectContainer::~omObjectContainer ( )
override

Member Function Documentation

◆ assignNewObjectID()

bool ml::omObjectContainer::assignNewObjectID ( const omIDType oldKey,
const omIDType newKey 
)

Assign a new ID to an existing object.

The new key must not exist in the objects container. Returns 'true' on success, 'false' otherwise.

◆ begin() [1/2]

objVec::iterator ml::omObjectContainer::begin ( )
inline

Returns a iterator pointing to the beginning of the object container.

Definition at line 109 of file mlObjMgrObjectContainer.h.

◆ begin() [2/2]

objVec::const_iterator ml::omObjectContainer::begin ( ) const
inline

Returns a const_iterator pointing to the beginning of the object container.

Definition at line 118 of file mlObjMgrObjectContainer.h.

◆ clear()

void ml::omObjectContainer::clear ( )

Remove all objects from container.

◆ createObject()

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.

◆ empty()

bool ml::omObjectContainer::empty ( ) const
inline

True if container is empty.

Definition at line 104 of file mlObjMgrObjectContainer.h.

◆ end() [1/2]

objVec::iterator ml::omObjectContainer::end ( )
inline

Returns a iterator pointing to the end of the object container.

Definition at line 113 of file mlObjMgrObjectContainer.h.

◆ end() [2/2]

objVec::const_iterator ml::omObjectContainer::end ( ) const
inline

Returns a const_iterator pointing to the end of the object container.

Definition at line 122 of file mlObjMgrObjectContainer.h.

◆ erase()

void ml::omObjectContainer::erase ( const omIDType key)

Erase the object whose key is given.

◆ exists()

bool ml::omObjectContainer::exists ( const omIDType key) const
inline

True if object with given key exists.

Definition at line 88 of file mlObjMgrObjectContainer.h.

◆ generateID()

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.

◆ getObject()

omObject& ml::omObjectContainer::getObject ( const omIDType key)

Writable access operator to individual objects.

No object is created if it does not exist. Instead an invalid object is returned (Check with isValid()).

◆ getObjMgr()

ObjMgr* ml::omObjectContainer::getObjMgr ( )
inline

Get access to ObjMgr instance.

Definition at line 127 of file mlObjMgrObjectContainer.h.

◆ insert()

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.

◆ insertConst()

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.

◆ operator[]() [1/2]

omObject& ml::omObjectContainer::operator[] ( const omIDType key)

Writable access operator to individual objects.

If the object does not exist it is created. Object information can be read and written.

◆ operator[]() [2/2]

const omObject& ml::omObjectContainer::operator[] ( const omIDType key) const

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.

◆ size()

size_t ml::omObjectContainer::size ( ) const
inline

Get number of objects in container.

Definition at line 99 of file mlObjMgrObjectContainer.h.

Friends And Related Function Documentation

◆ ObjMgr

friend class ObjMgr
friend

Definition at line 34 of file mlObjMgrObjectContainer.h.

Member Data Documentation

◆ _objMgr

ObjMgr* ml::omObjectContainer::_objMgr
protected

Macro for declaring methods for the runtime system.

Pointer to ObjMgr object.

Definition at line 45 of file mlObjMgrObjectContainer.h.


The documentation for this class was generated from the following file: