13 #ifndef ML_OBJ_MGR_OBJECT_CONTAINER_H
14 #define ML_OBJ_MGR_OBJECT_CONTAINER_H
19 #include "MLObjMgrSystem.h"
22 #if (_MSC_VER <= 1200) && defined(_XTREE_) && !defined(DISABLE_XTREE_MESSAGE)
23 # pragma message(" \nBe sure you have a fixed XTREE file from http://www.dinkumware.com/vc_fixes.html installed or YOUR MODULE WILL NOT WORK.\n")
37 typedef std::map<omIDType, omObject> objVec;
89 return objVec::find(key) != objVec::end();
99 inline size_t size()
const {
100 return objVec::size();
105 return objVec::empty();
110 return objVec::begin();
113 inline objVec::iterator
end() {
114 return objVec::end();
118 inline objVec::const_iterator
begin()
const {
119 return objVec::begin();
122 inline objVec::const_iterator
end()
const {
123 return objVec::end();
Class representing general ML objects that support import/export via strings (setPersistentState() an...
Database manager and communication switchboard.
Database (object container) - manages all objects.
objVec::const_iterator end() const
Returns a const_iterator pointing to the end of the object container.
objVec::iterator begin()
Returns a iterator pointing to the beginning of the object container.
ObjMgr * getObjMgr()
Get access to ObjMgr instance.
objVec::iterator iterator
const omObject & insertConst(const omObject &obj, MLuint32 minID=0, MLuint32 maxID=omID_MAX)
Insert object instance into container.
objVec::const_iterator begin() const
Returns a const_iterator pointing to the beginning of the object container.
bool exists(const omIDType &key) const
True if object with given key exists.
omObjectContainer(ObjMgr *objMgr)
objVec::const_iterator const_iterator
ObjMgr * _objMgr
Macro for declaring methods for the runtime system.
omObject & insert(const omObject &obj, MLuint32 minID=0, MLuint32 maxID=omID_MAX)
Insert object instance into container.
bool empty() const
True if container is empty.
objVec::iterator end()
Returns a iterator pointing to the end of the object container.
size_t size() const
Get number of objects in container.
bool assignNewObjectID(const omIDType &oldKey, const omIDType &newKey)
Assign a new ID to an existing object.
omObject & getObject(const omIDType &key)
Writable access operator to individual objects.
void clear()
Remove all objects from container.
omObject & createObject(MLuint32 minID=0, MLuint32 maxID=omID_MAX, const std::string &prefix="")
Creates and inserts object in the container.
~omObjectContainer() override
void erase(const omIDType &key)
Erase the object whose key is given.
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 create...
Base class that declares to basic functionality of an object.
#define omID_MAX
Maximum numerical value of an object Id.
#define ML_CLASS_HEADER(className)
Same like ML_CLASS_HEADER_EXPORTED with a non existing export symbol.