13 #ifndef ML_OBJ_MGR_OBJECT_H
14 #define ML_OBJ_MGR_OBJECT_H
19 #include "MLObjMgrSystem.h"
25 #define omID_WHITECARD "*"
31 class omObjectContainer;
36 class MLOBJMGR_EXPORT
omObject :
public Base,
protected std::map<omIDType, omAttributesVector>
41 typedef std::map<omIDType, omAttributesVector> attMtx;
128 return getAttribute(layer, item).isValid();
135 std::vector<std::pair<omIDType,omIDType> >
evalAttrAddrExpr(
const std::string &layerRegEx,
const std::string &itemRegEx)
const;
139 return attMtx::find(layer) != attMtx::end();
150 return attMtx::size();
155 return attMtx::empty();
160 return attMtx::begin();
163 inline attMtx::iterator
end() {
164 return attMtx::end();
168 inline attMtx::const_iterator
begin()
const {
169 return attMtx::begin();
172 inline attMtx::const_iterator
end()
const {
173 return attMtx::end();
Class representing general ML objects that support import/export via strings (setPersistentState() an...
Database manager and communication switchboard.
Manages the attribute data and takes care of allocation and deallocation.
Manages one layer of information.
Managed special flags of information address components.
Database (object container) - manages all objects.
Base class that declares to basic functionality of an object.
attMtx::iterator iterator
bool empty() const
True if there are no information stored in this object.
attMtx::iterator end()
Returns an iterator pointing to the end of the attributes matrix.
attMtx::const_iterator end() const
Returns a const_iterator pointing to the end of the attributes matrix.
bool exists(const omIDType &layer) const
True if attribute layer with given name exists.
void removeAttribute(const omIDType &layer, const omIDType &item)
Remove a specific attribute of the object.
omAttributesVector & getLayer(const omIDType &layer)
Writable access operator to layer.
omAttributesVector & createLayer(MLuint32 minID=0, MLuint32 maxID=omID_MAX, const std::string &prefix="")
Creates and inserts attribute vector in the object.
omIDType _id
Object identifier. Must be unique.
omAttribute & getAttribute(const omIDType &layer, const omIDType &item)
Read/write access to individual attributes.
omObject(const omObject &obj)
attMtx::const_iterator const_iterator
omFlags _flags
Macro for declaring methods for the runtime system.
omFlags & flags()
Writable flags access.
size_t size() const
Get number of information layers.
attMtx::iterator begin()
Returns an iterator pointing to the beginning of the attributes matrix.
void clear()
Remove all attributes from container.
void erase(const omIDType &layer)
Erase the attribute layer whose name is given.
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.
const omFlags & flags() const
Read-Only flags access.
bool hasAttribute(const omIDType &layer, const omIDType &item) const
Check if a specific attribute does exist in the object.
ObjMgr * _objMgr
Pointer to ObjMgr object.
const omIDType & getID() const
Get method for object ID.
const omAttribute & getAttribute(const omIDType &layer, const omIDType &item) const
Read only access to individual attributes.
void setID(const omIDType &id)
Sets the ID of an object.
attMtx::const_iterator begin() const
Returns a const_iterator pointing to the beginning of the attributes matrix.
bool isValid() const
Check if this is a valid object (e.g. has been initialized).
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...
#define omID_MAX
Maximum numerical value of an object Id.
#define omID_DEFAULT
Default value of an object Id.
#define ML_CLASS_HEADER(className)
Same like ML_CLASS_HEADER_EXPORTED with a non existing export symbol.