MeVisLab Toolbox Reference
|
Base class that declares to basic functionality of an object. More...
#include <ObjMgr/mlObjMgrObject.h>
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 | |
ObjMgr * | objMgr () |
omFlags & | flags () |
Writable flags access. More... | |
const omFlags & | flags () const |
Read-Only flags access. More... | |
omObject & | operator= (const omObject &obj) |
Assignment operator. More... | |
bool | isValid () const |
Check if this is a valid object (e.g. has been initialized). More... | |
const omIDType & | getID () 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... | |
omAttributesVector & | createLayer (MLuint32 minID=0, MLuint32 maxID=omID_MAX, const std::string &prefix="") |
Creates and inserts attribute vector in the object. More... | |
omAttributesVector & | operator[] (const omIDType &layer) |
Returns reference to attributes vector of specified layer. More... | |
const omAttributesVector & | operator[] (const omIDType &layer) const |
Returns read only reference to attributes vector of specified layer. More... | |
omAttributesVector & | getLayer (const omIDType &layer) |
Writable access operator to layer. More... | |
omAttribute & | getAttribute (const omIDType &layer, const omIDType &item) |
Read/write access to individual attributes. More... | |
const omAttribute & | getAttribute (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 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 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 |
Base class that declares to basic functionality of an object.
Definition at line 36 of file mlObjMgrObject.h.
typedef attMtx::const_iterator ml::omObject::const_iterator |
Definition at line 64 of file mlObjMgrObject.h.
typedef attMtx::iterator ml::omObject::iterator |
Definition at line 63 of file mlObjMgrObject.h.
ml::omObject::omObject | ( | ) |
ml::omObject::omObject | ( | const omObject & | obj | ) |
|
override |
|
inline |
Returns an iterator pointing to the beginning of the attributes matrix.
Definition at line 159 of file mlObjMgrObject.h.
|
inline |
Returns a const_iterator pointing to the beginning of the attributes matrix.
Definition at line 168 of file mlObjMgrObject.h.
void ml::omObject::clear | ( | ) |
Remove all attributes from container.
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.
|
inline |
True if there are no information stored in this object.
Definition at line 154 of file mlObjMgrObject.h.
|
inline |
Returns an iterator pointing to the end of the attributes matrix.
Definition at line 163 of file mlObjMgrObject.h.
|
inline |
Returns a const_iterator pointing to the end of the attributes matrix.
Definition at line 172 of file mlObjMgrObject.h.
void ml::omObject::erase | ( | const omIDType & | layer | ) |
Erase the attribute layer whose name is given.
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.
|
inline |
True if attribute layer with given name exists.
Definition at line 138 of file mlObjMgrObject.h.
|
inline |
Writable flags access.
Definition at line 75 of file mlObjMgrObject.h.
|
inline |
Read-Only flags access.
Definition at line 79 of file mlObjMgrObject.h.
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.
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.
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
|
inline |
Get method for object ID.
Definition at line 92 of file mlObjMgrObject.h.
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()).
Check if a specific attribute does exist in the object.
Definition at line 127 of file mlObjMgrObject.h.
|
inline |
Check if this is a valid object (e.g. has been initialized).
Definition at line 87 of file mlObjMgrObject.h.
References omID_DEFAULT.
|
inline |
Definition at line 70 of file mlObjMgrObject.h.
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.
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()).
Remove a specific attribute of the object.
|
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.
|
inline |
Get number of information layers.
Definition at line 149 of file mlObjMgrObject.h.
|
friend |
Definition at line 38 of file mlObjMgrObject.h.
|
protected |
Macro for declaring methods for the runtime system.
Special flags
Definition at line 49 of file mlObjMgrObject.h.
|
protected |
Object identifier. Must be unique.
Definition at line 52 of file mlObjMgrObject.h.
|
protected |
Pointer to ObjMgr object.
Definition at line 55 of file mlObjMgrObject.h.