MeVisLabToolboxReference
ml::omObjectContainer Class Reference

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

#include <ObjMgr/mlObjMgrObjectContainer.h>

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

List of all members.

Public Types

typedef objVec::iterator iterator
typedef objVec::const_iterator const_iterator

Public Member Functions

 omObjectContainer (ObjMgr *objMgr)
 omObjectContainer ()
 ~omObjectContainer ()
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.
omObjectcreateObject (MLuint32 minID=0, MLuint32 maxID=omID_MAX, const std::string &prefix="")
 Creates and inserts object in the container.
bool assignNewObjectID (const omIDType &oldKey, const omIDType &newKey)
 Assign a new ID to an existing object.
omObjectoperator[] (const omIDType &key)
 Writable access operator to individual objects.
const omObjectoperator[] (const omIDType &key) const
 Read only access operator to individual objects.
omObjectgetObject (const omIDType &key)
 Writable access operator to individual objects.
omObjectinsert (const omObject &obj, MLuint32 minID=0, MLuint32 maxID=omID_MAX)
 Insert object instance into container.
const omObjectinsertConst (const omObject &obj, MLuint32 minID=0, MLuint32 maxID=omID_MAX)
 Insert object instance into container.
bool exists (const omIDType &key) const
 True if object with given key exists.
void erase (const omIDType &key)
 Erase the object whose key is given.
void clear ()
 Remove all objects from container.
size_t size () const
 Get number of objects in container.
bool empty () const
 True if container is empty.
objVec::iterator begin ()
 Returns a iterator pointing to the beginning of the object container.
objVec::iterator end ()
 Returns a iterator pointing to the end of the object container.
objVec::const_iterator begin () const
 Returns a const_iterator pointing to the beginning of the object container.
objVec::const_iterator end () const
 Returns a const_iterator pointing to the end of the object container.
ObjMgrgetObjMgr ()
 Get access to ObjMgr instance.

Protected Attributes

ObjMgr_objMgr
 Macro for declaring methods for the runtime system.

Friends

class ObjMgr

Detailed Description

Database (object container) - manages all objects.

Definition at line 32 of file mlObjMgrObjectContainer.h.


Member Typedef Documentation

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.


Constructor & Destructor Documentation

ml::omObjectContainer::omObjectContainer ( ObjMgr objMgr)
ml::omObjectContainer::omObjectContainer ( )
ml::omObjectContainer::~omObjectContainer ( )

Member Function Documentation

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.

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.

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.

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.

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

True if container is empty.

Definition at line 104 of file mlObjMgrObjectContainer.h.

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.

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.

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

Erase the object whose key is given.

bool ml::omObjectContainer::exists ( const omIDType key) const [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.

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()).

ObjMgr* ml::omObjectContainer::getObjMgr ( ) [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.

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.

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.

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

friend class ObjMgr [friend]

Definition at line 34 of file mlObjMgrObjectContainer.h.


Member Data Documentation

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: