MeVisLab Toolbox Reference
ml::omObject Class Reference

Base class that declares to basic functionality of an object. More...

#include <ObjMgr/mlObjMgrObject.h>

Inheritance diagram for ml::omObject:
ml::Base

Public Types

typedef attMtx::iterator iterator
 
typedef attMtx::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

 omObject ()
 
 omObject (const omObject &obj)
 
 ~omObject () override
 
ObjMgrobjMgr ()
 
omFlagsflags ()
 Writable flags access. More...
 
const omFlagsflags () const
 Read-Only flags access. More...
 
omObjectoperator= (const omObject &obj)
 Assignment operator. More...
 
bool isValid () const
 Check if this is a valid object (e.g. has been initialized). More...
 
const omIDTypegetID () const
 Get method for object ID. More...
 
omIDType generateID (MLuint32 minID=0, MLuint32 maxID=omID_MAX, const std::string &prefix="") const
 Generate unique layer ID. A prefix may be given in the prefix argument. No layer is actually created. More...
 
omAttributesVectorcreateLayer (MLuint32 minID=0, MLuint32 maxID=omID_MAX, const std::string &prefix="")
 Creates and inserts attribute vector in the object. More...
 
omAttributesVectoroperator[] (const omIDType &layer)
 Returns reference to attributes vector of specified layer. More...
 
const omAttributesVectoroperator[] (const omIDType &layer) const
 Returns read only reference to attributes vector of specified layer. More...
 
omAttributesVectorgetLayer (const omIDType &layer)
 Writable access operator to layer. More...
 
omAttributegetAttribute (const omIDType &layer, const omIDType &item)
 Read/write access to individual attributes. More...
 
const omAttributegetAttribute (const omIDType &layer, const omIDType &item) const
 Read only access to individual attributes. More...
 
bool hasAttribute (const omIDType &layer, const omIDType &item) const
 Check if a specific attribute does exist in the object. More...
 
void removeAttribute (const omIDType &layer, const omIDType &item)
 Remove a specific attribute of the object. More...
 
std::vector< std::pair< omIDType, omIDType > > evalAttrAddrExpr (const std::string &layerRegEx, const std::string &itemRegEx) const
 Returns vector with addresses (layer + info ID) that match the address component's regular expression. More...
 
bool exists (const omIDType &layer) const
 True if attribute layer with given name exists. More...
 
void erase (const omIDType &layer)
 Erase the attribute layer whose name is given. More...
 
void clear ()
 Remove all attributes from container. More...
 
size_t size () const
 Get number of information layers. More...
 
bool empty () const
 True if there are no information stored in this object. More...
 
attMtx::iterator begin ()
 Returns an iterator pointing to the beginning of the attributes matrix. More...
 
attMtx::iterator end ()
 Returns an iterator pointing to the end of the attributes matrix. More...
 
attMtx::const_iterator begin () const
 Returns a const_iterator pointing to the beginning of the attributes matrix. More...
 
attMtx::const_iterator end () const
 Returns a const_iterator pointing to the end of the attributes matrix. 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 Member Functions

void setID (const omIDType &id)
 Sets the ID of an object. More...
 
- 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...
 

Protected Attributes

omFlags _flags
 Macro for declaring methods for the runtime system. More...
 
omIDType _id
 Object identifier. Must be unique. More...
 
ObjMgr_objMgr
 Pointer to ObjMgr object. More...
 

Friends

class omObjectContainer
 

Detailed Description

Base class that declares to basic functionality of an object.

Definition at line 36 of file mlObjMgrObject.h.

Member Typedef Documentation

◆ const_iterator

typedef attMtx::const_iterator ml::omObject::const_iterator

Definition at line 64 of file mlObjMgrObject.h.

◆ iterator

typedef attMtx::iterator ml::omObject::iterator

Definition at line 63 of file mlObjMgrObject.h.

Constructor & Destructor Documentation

◆ omObject() [1/2]

ml::omObject::omObject ( )

◆ omObject() [2/2]

ml::omObject::omObject ( const omObject obj)

◆ ~omObject()

ml::omObject::~omObject ( )
override

Member Function Documentation

◆ begin() [1/2]

attMtx::iterator ml::omObject::begin ( )
inline

Returns an iterator pointing to the beginning of the attributes matrix.

Definition at line 159 of file mlObjMgrObject.h.

◆ begin() [2/2]

attMtx::const_iterator ml::omObject::begin ( ) const
inline

Returns a const_iterator pointing to the beginning of the attributes matrix.

Definition at line 168 of file mlObjMgrObject.h.

◆ clear()

void ml::omObject::clear ( )

Remove all attributes from container.

◆ createLayer()

omAttributesVector& ml::omObject::createLayer ( MLuint32  minID = 0,
MLuint32  maxID = omID_MAX,
const std::string &  prefix = "" 
)

Creates and inserts attribute vector in the object.

The numerical layer ID is generated in the given range. A prefix may be given in the prefix argument.

◆ empty()

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

True if there are no information stored in this object.

Definition at line 154 of file mlObjMgrObject.h.

◆ end() [1/2]

attMtx::iterator ml::omObject::end ( )
inline

Returns an iterator pointing to the end of the attributes matrix.

Definition at line 163 of file mlObjMgrObject.h.

◆ end() [2/2]

attMtx::const_iterator ml::omObject::end ( ) const
inline

Returns a const_iterator pointing to the end of the attributes matrix.

Definition at line 172 of file mlObjMgrObject.h.

◆ erase()

void ml::omObject::erase ( const omIDType layer)

Erase the attribute layer whose name is given.

◆ evalAttrAddrExpr()

std::vector<std::pair<omIDType,omIDType> > ml::omObject::evalAttrAddrExpr ( const std::string &  layerRegEx,
const std::string &  itemRegEx 
) const

Returns vector with addresses (layer + info ID) that match the address component's regular expression.

◆ exists()

bool ml::omObject::exists ( const omIDType layer) const
inline

True if attribute layer with given name exists.

Definition at line 138 of file mlObjMgrObject.h.

◆ flags() [1/2]

omFlags& ml::omObject::flags ( )
inline

Writable flags access.

Definition at line 75 of file mlObjMgrObject.h.

◆ flags() [2/2]

const omFlags& ml::omObject::flags ( ) const
inline

Read-Only flags access.

Definition at line 79 of file mlObjMgrObject.h.

◆ generateID()

omIDType ml::omObject::generateID ( MLuint32  minID = 0,
MLuint32  maxID = omID_MAX,
const std::string &  prefix = "" 
) const

Generate unique layer ID. A prefix may be given in the prefix argument. No layer is actually created.

◆ getAttribute() [1/2]

omAttribute& ml::omObject::getAttribute ( const omIDType layer,
const omIDType item 
)

Read/write access to individual attributes.

In contrast to the operator[] member the attribute is not created if it does not exist. Instead an invalid attribute (check with isValid()) is returned if the item does not exist in the layer.

◆ getAttribute() [2/2]

const omAttribute& ml::omObject::getAttribute ( const omIDType layer,
const omIDType item 
) const

Read only access to individual attributes.

Returns an invalid attribute (Check with isValid()) if the item does not exist in the layer

◆ getID()

const omIDType& ml::omObject::getID ( ) const
inline

Get method for object ID.

Definition at line 92 of file mlObjMgrObject.h.

◆ getLayer()

omAttributesVector& ml::omObject::getLayer ( const omIDType layer)

Writable access operator to layer.

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

◆ hasAttribute()

bool ml::omObject::hasAttribute ( const omIDType layer,
const omIDType item 
) const
inline

Check if a specific attribute does exist in the object.

Definition at line 127 of file mlObjMgrObject.h.

◆ isValid()

bool ml::omObject::isValid ( void  ) const
inline

Check if this is a valid object (e.g. has been initialized).

Definition at line 87 of file mlObjMgrObject.h.

References omID_DEFAULT.

◆ objMgr()

ObjMgr* ml::omObject::objMgr ( )
inline

Definition at line 70 of file mlObjMgrObject.h.

◆ operator=()

omObject& ml::omObject::operator= ( const omObject obj)

Assignment operator.

◆ operator[]() [1/2]

omAttributesVector& ml::omObject::operator[] ( const omIDType layer)

Returns reference to attributes vector of specified layer.

Can be used to access specific attributes of this object (e.g. object[layer][item]) Creates attributes vector if not yet existent.

◆ operator[]() [2/2]

const omAttributesVector& ml::omObject::operator[] ( const omIDType layer) const

Returns read only reference to attributes vector of specified layer.

Can be used to access specific attributes of this object (e.g. object[layer][item]) Returns invalid attributes vector if not yet existent (Check with isValid()).

◆ removeAttribute()

void ml::omObject::removeAttribute ( const omIDType layer,
const omIDType item 
)

Remove a specific attribute of the object.

◆ setID()

void ml::omObject::setID ( const omIDType id)
protected

Sets the ID of an object.

Stores the ID in the class member _id but also as an attribute in the global information layer.

◆ size()

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

Get number of information layers.

Definition at line 149 of file mlObjMgrObject.h.

Friends And Related Function Documentation

◆ omObjectContainer

friend class omObjectContainer
friend

Definition at line 38 of file mlObjMgrObject.h.

Member Data Documentation

◆ _flags

omFlags ml::omObject::_flags
protected

Macro for declaring methods for the runtime system.

Special flags

Definition at line 49 of file mlObjMgrObject.h.

◆ _id

omIDType ml::omObject::_id
protected

Object identifier. Must be unique.

Definition at line 52 of file mlObjMgrObject.h.

◆ _objMgr

ObjMgr* ml::omObject::_objMgr
protected

Pointer to ObjMgr object.

Definition at line 55 of file mlObjMgrObject.h.


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