MeVisLabToolboxReference
|
Base class for all modules that wish to use and communicate (send and receive notifications) with the ObjMgr module. More...
#include <ObjMgr/mlObjMgrClient.h>
Public Types | |
enum | EventReceiveMode { EVENTS_NONE = 0, EVENTS_SELECTED, EVENTS_ALL, NUM_EVENT_RECEIVE_MODES } |
Macro for declaring methods for the runtime system. More... | |
Public Member Functions | |
~ObjMgrClient () | |
Destructor. Removes this ObjMgrClient from the ObjMgr. | |
void | addAcceptedObjectID (const std::string &id) |
Add object ID to set of accepted objects (id can be a regular expression). | |
void | clearAcceptedObjectIDs () |
Clear set of accepted objects. | |
void | addAcceptedInfoLayerName (const std::string &layerName) |
Add layer name to set of accepted layers (layerName can be a regular expression). | |
void | clearAcceptedInfoLayerNames () |
Clear set of accepted layers. | |
void | setEventReceiveMode (EventReceiveMode mode) |
Modify current events receive mode settings. | |
EventReceiveMode | getEventReceiveMode () |
Returns current events receive mode settings. | |
void | sendNotification () |
Send notification to all other modules connected to the ObjMgr. | |
const omEventContainer & | getEventContainer () const |
Get container with object manager events,. | |
void | clearEventContainer () |
Clear event container. | |
Public Attributes | |
IntField * | priorityFld |
Priority determines the order in which events are send to ObjMgrClient modules. Default is 10000;. | |
StringField * | debugCommentFld |
Value of this field is used in debug output to distinguish different instances. | |
Static Public Attributes | |
static const char * | EventReceiveModeStrings [NUM_EVENT_RECEIVE_MODES] |
Define strings for all event receive modes. These can be used for enum fields. | |
Protected Member Functions | |
virtual void | handleNotification (Field *field) |
Called when a field in the field container is changed. | |
virtual void | handleObjMgrNotification () |
This function is called when the connected ObjMgr sends out a notification. | |
virtual void | objContainerChanged () |
This function is called when the objectContainer has been changed. | |
const omObjectContainer * | getConstObjContainer () const |
omObjectContainer * | getObjContainer () |
omEventContainer & | getMutableEventContainer () |
Get read/write access to event container. | |
void | registerWithSourceModule () |
Add this module to the source module's container of connected modules. | |
void | cancelSourceModuleRegistration () |
Remove this module from the source module's container of connected modules. | |
void | registerWithObjMgr () |
Register this and all connected modules with ObjMgr. | |
void | cancelObjMgrRegistration () |
Remove registration of this and all connected modules from ObjMgr. | |
virtual std::string | getDebugComment () const |
Return debug comment. | |
ObjMgrClient (int inputNum, int outputNum, EventReceiveMode eventReceiveMode) | |
Constructor. | |
Protected Attributes | |
ObjMgr * | _objMgr |
Pointer to ObjMgr object. | |
ObjMgrBase * | _sourceModule |
Pointer to module, to which this module is connected. | |
MLint32 | _skipNotificationCount |
If the value is >= the notification recursion depth in the ObjMgr, the ObjMgrClient does not notify attached FieldListeners. | |
omEventContainer | _events |
Container of changes that have occurred. | |
EventReceiveMode | _eventReceiveMode |
Determines which events will be received. | |
std::set< std::string > | _acceptedObjects |
Accept only events regarding objects stored in this set. | |
std::set< std::string > | _acceptedInfoLayers |
Accept only events of layers that are stored in this set. | |
Friends | |
class | ObjMgr |
class | ObjMgrBase |
Base class for all modules that wish to use and communicate (send and receive notifications) with the ObjMgr module.
Definition at line 50 of file mlObjMgrClient.h.
Macro for declaring methods for the runtime system.
Event receive modes
Definition at line 63 of file mlObjMgrClient.h.
ml::ObjMgrClient::ObjMgrClient | ( | int | inputNum, |
int | outputNum, | ||
EventReceiveMode | eventReceiveMode | ||
) | [protected] |
Constructor.
Register this ObjMgrClient with the ObjMgr. If eventReceiveMode is EVENTS_ALL or EVENTS_SELECTED the ObjMgrClient will receive events, only a minor number of modules need this. Think about it carefully! Be sure to clear the event container from time to time if you choose to receive events!
ml::ObjMgrClient::~ObjMgrClient | ( | ) |
Destructor. Removes this ObjMgrClient from the ObjMgr.
void ml::ObjMgrClient::addAcceptedInfoLayerName | ( | const std::string & | layerName | ) | [inline] |
Add layer name to set of accepted layers (layerName can be a regular expression).
Definition at line 181 of file mlObjMgrClient.h.
void ml::ObjMgrClient::addAcceptedObjectID | ( | const std::string & | id | ) | [inline] |
Add object ID to set of accepted objects (id can be a regular expression).
Definition at line 172 of file mlObjMgrClient.h.
void ml::ObjMgrClient::cancelObjMgrRegistration | ( | ) | [protected] |
Remove registration of this and all connected modules from ObjMgr.
void ml::ObjMgrClient::cancelSourceModuleRegistration | ( | ) | [protected] |
Remove this module from the source module's container of connected modules.
void ml::ObjMgrClient::clearAcceptedInfoLayerNames | ( | ) | [inline] |
Clear set of accepted layers.
Definition at line 185 of file mlObjMgrClient.h.
void ml::ObjMgrClient::clearAcceptedObjectIDs | ( | ) | [inline] |
Clear set of accepted objects.
Definition at line 176 of file mlObjMgrClient.h.
void ml::ObjMgrClient::clearEventContainer | ( | ) | [inline] |
Clear event container.
This must be done, when the last event has been processed, by the module since the ObjMgr appends new events and never empties the container itself.
Definition at line 210 of file mlObjMgrClient.h.
const omObjectContainer* ml::ObjMgrClient::getConstObjContainer | ( | ) | const [inline, protected] |
Definition at line 107 of file mlObjMgrClient.h.
virtual std::string ml::ObjMgrClient::getDebugComment | ( | ) | const [inline, protected, virtual] |
const omEventContainer& ml::ObjMgrClient::getEventContainer | ( | ) | const [inline] |
Get container with object manager events,.
Definition at line 203 of file mlObjMgrClient.h.
EventReceiveMode ml::ObjMgrClient::getEventReceiveMode | ( | ) | [inline] |
Returns current events receive mode settings.
Definition at line 194 of file mlObjMgrClient.h.
omEventContainer& ml::ObjMgrClient::getMutableEventContainer | ( | ) | [inline, protected] |
Get read/write access to event container.
Definition at line 111 of file mlObjMgrClient.h.
omObjectContainer* ml::ObjMgrClient::getObjContainer | ( | ) | [inline, protected] |
Definition at line 108 of file mlObjMgrClient.h.
virtual void ml::ObjMgrClient::handleNotification | ( | Field * | field | ) | [protected, virtual] |
Called when a field in the field container is changed.
Derived classes must call its parent implementation of handleNotification() in front.
Reimplemented from ml::Module.
virtual void ml::ObjMgrClient::handleObjMgrNotification | ( | ) | [inline, protected, virtual] |
This function is called when the connected ObjMgr sends out a notification.
Definition at line 102 of file mlObjMgrClient.h.
virtual void ml::ObjMgrClient::objContainerChanged | ( | ) | [inline, protected, virtual] |
This function is called when the objectContainer has been changed.
Definition at line 105 of file mlObjMgrClient.h.
void ml::ObjMgrClient::registerWithObjMgr | ( | ) | [protected] |
Register this and all connected modules with ObjMgr.
void ml::ObjMgrClient::registerWithSourceModule | ( | ) | [protected] |
Add this module to the source module's container of connected modules.
void ml::ObjMgrClient::sendNotification | ( | ) |
Send notification to all other modules connected to the ObjMgr.
This ObjMgrClient does not receive its own notification.
void ml::ObjMgrClient::setEventReceiveMode | ( | EventReceiveMode | mode | ) | [inline] |
Modify current events receive mode settings.
Definition at line 190 of file mlObjMgrClient.h.
friend class ObjMgr [friend] |
Definition at line 52 of file mlObjMgrClient.h.
friend class ObjMgrBase [friend] |
Definition at line 53 of file mlObjMgrClient.h.
std::set<std::string> ml::ObjMgrClient::_acceptedInfoLayers [protected] |
Accept only events of layers that are stored in this set.
Definition at line 95 of file mlObjMgrClient.h.
std::set<std::string> ml::ObjMgrClient::_acceptedObjects [protected] |
Accept only events regarding objects stored in this set.
Definition at line 92 of file mlObjMgrClient.h.
EventReceiveMode ml::ObjMgrClient::_eventReceiveMode [protected] |
Determines which events will be received.
Definition at line 89 of file mlObjMgrClient.h.
omEventContainer ml::ObjMgrClient::_events [protected] |
Container of changes that have occurred.
Definition at line 86 of file mlObjMgrClient.h.
ObjMgr* ml::ObjMgrClient::_objMgr [protected] |
Pointer to ObjMgr object.
Definition at line 76 of file mlObjMgrClient.h.
MLint32 ml::ObjMgrClient::_skipNotificationCount [protected] |
If the value is >= the notification recursion depth in the ObjMgr, the ObjMgrClient does not notify attached FieldListeners.
Connected modules, however, are still notified.
Definition at line 83 of file mlObjMgrClient.h.
ObjMgrBase* ml::ObjMgrClient::_sourceModule [protected] |
Pointer to module, to which this module is connected.
Definition at line 79 of file mlObjMgrClient.h.
Value of this field is used in debug output to distinguish different instances.
Definition at line 166 of file mlObjMgrClient.h.
const char* ml::ObjMgrClient::EventReceiveModeStrings[NUM_EVENT_RECEIVE_MODES] [static] |
Define strings for all event receive modes. These can be used for enum fields.
Definition at line 71 of file mlObjMgrClient.h.
Priority determines the order in which events are send to ObjMgrClient modules. Default is 10000;.
Definition at line 163 of file mlObjMgrClient.h.