MeVisLabToolboxReference
|
00001 // **InsertLicense** code 00002 //------------------------------------------------------------------------- 00005 00010 //------------------------------------------------------------------------- 00011 00012 #ifndef __mlObjMgrEvent_H 00013 #define __mlObjMgrEvent_H 00014 00015 #ifndef __MLObjMgrSystem_H 00016 #include "MLObjMgrSystem.h" 00017 #endif 00018 #ifndef __mlObjMgrObjectID_H 00019 #include "mlObjMgrObjectID.h" 00020 #endif 00021 #ifndef __mlObjMgrFlags_H 00022 #include "mlObjMgrFlags.h" 00023 #endif 00024 #ifndef __mlObjMgrData_H 00025 #include "mlObjMgrData.h" 00026 #endif 00027 00028 ML_START_NAMESPACE 00029 00030 // Forward declaration of classes 00031 class omAttribute; 00032 class omObject; 00033 00036 class ObjMgrEvent 00037 { 00038 public: 00039 00041 enum EventType { 00042 NIL = 0, 00043 OBJECT_CREATED, 00044 OBJECT_REMOVED, 00045 ATTRIBUTE_CREATED, 00046 ATTRIBUTE_MODIFIED, 00047 ATTRIBUTE_REMOVED, 00048 CONNECTED_TO_DATABASE, 00049 NUM_EVENT_TYPES 00050 }; 00051 00053 static const char *EventTypeStrings[NUM_EVENT_TYPES]; 00054 00055 public: 00056 00058 EventType type; 00059 00061 bool nonMaskable; 00062 00064 size_t clientID; 00065 00067 omIDType objectID; 00069 omIDType layerID; 00071 omIDType infoID; 00072 00074 omFlags objectFlags; 00075 omFlags layerFlags; 00076 omFlags infoFlags; 00077 00079 omData newValue; 00081 omData prevValue; 00082 00083 ObjMgrEvent() 00084 : type(NIL), nonMaskable(false), clientID(0) {} 00085 ObjMgrEvent(EventType _type, const omIDType &_objectID, const omIDType &_layerID, const omIDType &_infoID, const omFlags &_objectFlags, const omFlags &_layerFlags, const omFlags &_infoFlags, const omData &_newValue, const omData &_prevValue, bool _nonMaskable = false) 00086 : type(_type), nonMaskable(_nonMaskable), clientID(0), objectID(_objectID), layerID(_layerID), infoID(_infoID), objectFlags(_objectFlags), layerFlags(_layerFlags), infoFlags(_infoFlags), newValue(_newValue), prevValue(_prevValue) {} 00087 00088 ObjMgrEvent(EventType _type, void* _clientID, bool _nonMaskable = false); 00089 00090 ObjMgrEvent(EventType _type, const omObject &_object, const omFlags &_flags, bool _nonMaskable = false); 00091 ObjMgrEvent(EventType _type, const omObject &_object, bool _nonMaskable = false); 00092 00093 ObjMgrEvent(EventType _type, const omAttribute &_attribute, const omFlags &_flags, bool _nonMaskable = false); 00094 ObjMgrEvent(EventType _type, const omAttribute &_attribute, bool _nonMaskable = false); 00095 00096 ObjMgrEvent(EventType _type, const omAttribute &_attribute, const omFlags &_flags, const omData &_newValue, bool _nonMaskable = false); 00097 ObjMgrEvent(EventType _type, const omAttribute &_attribute, const omData &_newValue, bool _nonMaskable = false); 00098 00099 ObjMgrEvent(EventType _type, const omAttribute &_attribute, const omFlags &_flags, const omData &_newValue, const omData &_prevValue, bool _nonMaskable = false); 00100 ObjMgrEvent(EventType _type, const omAttribute &_attribute, const omData &_newValue, const omData &_prevValue, bool _nonMaskable = false); 00101 00103 bool operator ==(const ObjMgrEvent &ev) const; 00104 }; 00105 00107 typedef std::list<ObjMgrEvent> omEventContainer; 00108 00109 ML_END_NAMESPACE 00110 00111 #endif // __mlObjMgrEvent_H