13 #ifndef ML_OBJ_MGR_CLIENT_H
14 #define ML_OBJ_MGR_CLIENT_H
19 #include "MLObjMgrSystem.h"
26 # define mlDebugBySym(SYM,COUTS) { const RuntimeType *rt = getClassTypeId(); \
27 ML_CHECK_RUNTIME_TYPE(rt); \
28 _mlDebugConst(((std::string)ML_CONSTANT_PREFIX)+ \
29 rt->getName() + "-" + (SYM), \
33 # define mlDebugBySym(SYM,COUTS)
36 #define omcDebug(msg) mlDebug(getFieldStringValue("instanceName") << " (" << debugCommentFld->getStringValue() << "): " << msg)
37 #define omcDebugBySym(sym,msg) { mlDebugBySym(sym, getFieldStringValue("instanceName") << " (" << debugCommentFld->getStringValue() << "): " << msg); \
63 NUM_EVENT_RECEIVE_MODES
67 static const char *EventReceiveModeStrings[NUM_EVENT_RECEIVE_MODES];
121 return debugCommentFld->getStringValue();
136 "Invalid usage of copy constructor");
143 "Invalid usage of assignment operator");
148 omObjectContainer *_objectContainer;
151 BaseField *objectsInFld;
154 void gotNotification();
169 _acceptedObjects.insert(
id);
173 _acceptedObjects.clear();
178 _acceptedInfoLayers.insert(layerName);
182 _acceptedInfoLayers.clear();
187 _eventReceiveMode= mode;
191 return _eventReceiveMode;
Base class for all fields used in the ML.
Field to encapsulate an integer value.
Base class for an image processing module of the ML.
Base class for all communicating modules.
friend class ObjMgrClient
Base class for all modules that wish to use and communicate (send and receive notifications) with the...
void clearAcceptedObjectIDs()
Clear set of accepted objects.
ObjMgr * _objMgr
Pointer to ObjMgr object.
MLint32 _skipNotificationCount
If the value is >= the notification recursion depth in the ObjMgr, the ObjMgrClient does not notify a...
void clearEventContainer()
Clear event container.
virtual void objContainerChanged()
This function is called when the objectContainer has been changed.
ObjMgrClient(int inputNum, int outputNum, EventReceiveMode eventReceiveMode)
Constructor.
void addAcceptedInfoLayerName(const std::string &layerName)
Add layer name to set of accepted layers (layerName can be a regular expression).
ObjMgrBase * _sourceModule
Pointer to module, to which this module is connected.
IntField * priorityFld
Priority determines the order in which events are send to ObjMgrClient modules. Default is 10000;.
std::set< std::string > _acceptedObjects
Accept only events regarding objects stored in this set.
void cancelSourceModuleRegistration()
Remove this module from the source module's container of connected modules.
void sendNotification()
Send notification to all other modules connected to the ObjMgr.
EventReceiveMode
Macro for declaring methods for the runtime system.
omEventContainer & getMutableEventContainer()
Get read/write access to event container.
omObjectContainer * getObjContainer()
const omObjectContainer * getConstObjContainer() const
void handleNotification(Field *field) override
Called when a field in the field container is changed.
void clearAcceptedInfoLayerNames()
Clear set of accepted layers.
void registerWithObjMgr()
Register this and all connected modules with ObjMgr.
void setEventReceiveMode(EventReceiveMode mode)
Modify current events receive mode settings.
omEventContainer _events
Container of changes that have occurred.
std::set< std::string > _acceptedInfoLayers
Accept only events of layers that are stored in this set.
StringField * debugCommentFld
Value of this field is used in debug output to distinguish different instances.
void addAcceptedObjectID(const std::string &id)
Add object ID to set of accepted objects (id can be a regular expression).
~ObjMgrClient() override
Destructor. Removes this ObjMgrClient from the ObjMgr.
EventReceiveMode _eventReceiveMode
Determines which events will be received.
EventReceiveMode getEventReceiveMode()
Returns current events receive mode settings.
void registerWithSourceModule()
Add this module to the source module's container of connected modules.
std::string getDebugComment() const override
Return debug comment.
virtual void handleObjMgrNotification()
This function is called when the connected ObjMgr sends out a notification.
void cancelObjMgrRegistration()
Remove registration of this and all connected modules from ObjMgr.
const omEventContainer & getEventContainer() const
Get container with object manager events,.
Database manager and communication switchboard.
Field to encapsulate a string value.
Database (object container) - manages all objects.
#define ML_ABSTRACT_CLASS_HEADER(className)
Same like ML_ABSTRACT_CLASS_HEADER_EXPORTED with a non existing export symbol.
#define ML_PROGRAMMING_ERROR
A case occurred which should not appear and here are a variety of reasons, typically it is a programm...
#define ML_PRINT_FATAL_ERROR(FUNC_NAME, REASON, HANDLING)
Like ML_PRINT_FATAL_ERROR_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ) without a runtime object to be du...
std::list< ObjMgrEvent > omEventContainer
Declare type for event container;.