#include <eventmanagerbase.h>
Public Member Functions | |
EventManagerBase () | |
virtual | ~EventManagerBase () |
virtual void | shutDownEM () |
virtual void | fireEvent (UaEventData *pEventData) |
virtual void | registerEventNotifier (const UaNodeId &parentNotifier, const UaNodeId &newNotifier) |
virtual void | registerEventSource (const UaNodeId &parentNotifier, const UaNodeId &newSource) |
virtual void | unregisterEventNotifier (const UaNodeId ¬ifier) |
virtual OpcUa_Boolean | isNotifier (const UaNodeId &eventNotifier) const |
< [in] NodeId of the node to check for beeing an event notifier | |
virtual OpcUa_Boolean | isEventManagerRootNotifier (const UaNodeId ¬ifier) const |
< [in] NodeId of the event notifier used in the event monitored item | |
virtual OpcUa_Boolean | inNotifierTree (const UaNodeId &eventNotifier, const UaNodeId &sourceNode, UaEventData *pEventData) const |
< [in] Event data for the current event. This information can be used by derived classes to do additional checks based on the event data by overwriting this function. | |
virtual UaStatus | beginEventTransaction (EventManagerCallback *, const ServiceContext &, OpcUa_UInt32, OpcUa_Handle &) |
virtual UaStatus | beginStartMonitoring (OpcUa_Handle, OpcUa_UInt32, OpcUa_UInt32, EventCallback *, const EventMonitoringContextCreate &) |
virtual UaStatus | beginModifyMonitoring (OpcUa_Handle, OpcUa_UInt32, OpcUa_UInt32, OpcUa_UInt32, const EventMonitoringContext &) |
virtual UaStatus | beginStopMonitoring (OpcUa_Handle hEventManagerContext, OpcUa_UInt32, OpcUa_UInt32, OpcUa_UInt32) |
virtual UaStatus | finishEventTransaction (OpcUa_Handle) |
virtual UaStatus | beginConditionRefresh (const ServiceContext &serviceContext, OpcUa_UInt32 hEventItem, const UaByteString &, const UaByteString &) |
virtual UaStatus | sendRefreshRequired (OpcUa_UInt32 hEventItem, const UaByteString &eventId) |
Static Public Member Functions | |
static void | buildEventId (const UaByteString &userEventId, UaByteString &clientEventId) |
static void | getUserEventId (const UaByteString &clientEventId, UaByteString &userEventId) |
static void | registerEventType (const UaNodeId &superType, const UaNodeId &newType) |
static OpcUa_UInt32 | registerEventField (const UaQualifiedName &fieldName) |
static OpcUa_UInt32 | registerEventField (const UaQualifiedNameArray &path) |
static OpcUa_UInt32 | registerEventField (const UaString &fieldName) |
static void | unregisterEventType (const UaNodeId &typeToRemove) |
static void | unregisterEventField (OpcUa_UInt32 fieldIndex) |
static OpcUa_UInt32 | getFieldIndex (const OpcUa_SimpleAttributeOperand &selectClause, OpcUa_StatusCode &fieldResult) |
static OpcUa_Boolean | isOfType (const UaNodeId &eventType, const UaNodeId &typeToEvaluate) |
static void | clearStaticMembers () |
Implements the EventManager interface base functionality independent of the node management It handles all active event monitored items and all event filtering and event field selection.
EventManagerBase::EventManagerBase | ( | ) |
Constructs an EventManagerBase object providing a base implementation of the EventManager interface.
EventManagerBase::~EventManagerBase | ( | ) | [virtual] |
Destroys the EventManagerBase object.
UaStatus EventManagerBase::beginConditionRefresh | ( | const ServiceContext & | serviceContext, |
OpcUa_UInt32 | hEventItem, | ||
const UaByteString & | beginEventId, | ||
const UaByteString & | endEventId | ||
) | [virtual] |
This method triggers a refresh for all conditions of interest in the EventManager.
Reimplemented from EventManager.
UaStatus EventManagerBase::beginEventTransaction | ( | EventManagerCallback * | pCallback, |
const ServiceContext & | serviceContext, | ||
OpcUa_UInt32 | hTransaction, | ||
OpcUa_Handle & | hEventManagerContext | ||
) | [virtual] |
Begins a transaction for changing the list of event monitored items.
pCallback | interface used for the transaction. The IOManager must use this interface to finish the action for each passed node in the transaction. |
serviceContext | General context for the service calls containing information like the session object, return diagnostic mask and timeout hint. |
hTransaction | Handle for the transaction used by the SDK to identify the transaction in the callbacks. This handle was passed in to the IOManager with the beginTransaction method. |
hEventManagerContext | a Variable with all information about the current context. |
Implements EventManager.
UaStatus EventManagerBase::beginModifyMonitoring | ( | OpcUa_Handle | hEventManagerContext, |
OpcUa_UInt32 | callbackHandle, | ||
OpcUa_UInt32 | eventManagerIndex, | ||
OpcUa_UInt32 | hEventItem, | ||
const EventMonitoringContext & | eventMonitoringContext | ||
) | [virtual] |
Begins to modify monitoring.
hEventManagerContext | The handle for the transaction context returned by beginEventTransaction. |
callbackHandle | Handle for the node in the callback. |
eventManagerIndex | Index of the EventManager in the SDK. |
hEventItem | an EventItem used to fire an Event. |
eventMonitoringContext | Settings for an event monitored item contained in the EventMonitoringContext class. |
Implements EventManager.
UaStatus EventManagerBase::beginStartMonitoring | ( | OpcUa_Handle | hEventManagerContext, |
OpcUa_UInt32 | callbackHandle, | ||
OpcUa_UInt32 | eventManagerIndex, | ||
EventCallback * | pEventCallback, | ||
const EventMonitoringContextCreate & | eventMonitoringContext | ||
) | [virtual] |
Begind to start monitoring.
hEventManagerContext | The handle for the transaction context returned by beginEventTransaction. |
callbackHandle | Handle for the node in the callback. |
eventManagerIndex | Index of the EventManager in the SDK. |
pEventCallback | The Event callback interface of the monitored Item. |
eventMonitoringContext | Settings for an event monitored item contained in the EventMonitoringContext class. |
Implements EventManager.
UaStatus EventManagerBase::beginStopMonitoring | ( | OpcUa_Handle | hEventManagerContext, |
OpcUa_UInt32 | callbackHandle, | ||
OpcUa_UInt32 | eventManagerIndex, | ||
OpcUa_UInt32 | hEventItem | ||
) | [virtual] |
Begins to stop monitoring.
hEventManagerContext | a Variable with all information about the current context. |
callbackHandle | Handle for the node in the callback. |
eventManagerIndex | an Index of different EventManagers. |
hEventItem | an EventItem used to fire an Event. |
Implements EventManager.
void EventManagerBase::buildEventId | ( | const UaByteString & | userEventId, |
UaByteString & | clientEventId | ||
) | [static] |
Build a unique EventId that can be send to the client and include a user specific part if provided.
[in] | userEventId | Optional user specific part included in the event id |
[out] | clientEventId | Unique EventId that can be send to the client |
void EventManagerBase::clearStaticMembers | ( | ) | [static] |
Internal SDK method to clean up static members.
UaStatus EventManagerBase::finishEventTransaction | ( | OpcUa_Handle | hEventManagerContext ) | [virtual] |
Finishes the transaction for changing the list of event monitored items.
[in] | hEventManagerContext | Handle of the event transaction |
Implements EventManager.
void EventManagerBase::fireEvent | ( | UaEventData * | pEventData ) | [virtual] |
Fire an event with the passed event data
[in] | pEventData | The data for the event to fire |
OpcUa_UInt32 EventManagerBase::getFieldIndex | ( | const OpcUa_SimpleAttributeOperand & | selectClause, |
OpcUa_StatusCode & | fieldResult | ||
) | [static] |
Internal SDK method to get the index of a registered event field.
void EventManagerBase::getUserEventId | ( | const UaByteString & | clientEventId, |
UaByteString & | userEventId | ||
) | [static] |
Get the user part of a unique EventId that was sent to the client.
[in] | clientEventId | Unique EventId that was sent to the client |
[out] | userEventId | Optional user specific part included in the event id |
OpcUa_Boolean EventManagerBase::inNotifierTree | ( | const UaNodeId & | eventNotifier, |
const UaNodeId & | sourceNode, | ||
UaEventData * | pEventData | ||
) | const [virtual] |
< [in] Event data for the current event. This information can be used by derived classes to do additional checks based on the event data by overwriting this function.
Checks wether the passed sourceNode matches the event notifier or is part of the event notifier tree below the eventNotifier. A derived class can overwrite this check to apply its own logic for the event notifier tree.
[in] | eventNotifier | NodeId of the event notifier used in the event monitored item |
[in] | sourceNode | NodeId of the source node of the event |
OpcUa_Boolean EventManagerBase::isEventManagerRootNotifier | ( | const UaNodeId & | notifier ) | const [virtual] |
< [in] NodeId of the event notifier used in the event monitored item
Checks whether the passed NodeId is a root notifier for this EventManager. A root notifier is a node that can be used to receive all events from this EventManager. A derived class is able to overwrite this method to allow additional root notifiers in addition to the Server object that is the root notifier for the whole server. If a node is flagged as root notifier and it is used as monitored item, it is not checked if the source node is part of the notifier hirarchy.
OpcUa_Boolean EventManagerBase::isNotifier | ( | const UaNodeId & | node ) | const [virtual] |
< [in] NodeId of the node to check for beeing an event notifier
Checks wether the passed NodeId is the NodeId of an event notifier object. A derived class can overwrite this check to apply its own for verifying if a node is relevant for monitoring in this EventManager.
OpcUa_Boolean EventManagerBase::isOfType | ( | const UaNodeId & | eventType, |
const UaNodeId & | typeToEvaluate | ||
) | [static] |
Internal SDK method used to evaluate the event type with the evnt filter
[in] | eventType | Event type that is requested as filter |
[in] | typeToEvaluate | Actual event type that needs to be evaluated with the filter event type |
OpcUa_UInt32 EventManagerBase::registerEventField | ( | const UaQualifiedName & | fieldName ) | [static] |
Add a custom event field to assign a unique index for selection of the field of the custom type.
The field name is used by the EventManagerBase to verifiy if the client selected event field is valid and to get the unique index for optimized access to the event field through UaEventData::getFieldData().
fieldName | Field name for a field that is a direct component of the event type. |
OpcUa_UInt32 EventManagerBase::registerEventField | ( | const UaString & | fieldName ) | [static] |
Add a custom event field to assign a unique index for selection of the field of the custom type.
The field name is used by the EventManagerBase to verifiy if the client selected event field is valid and to get the unique index for optimized access to the event field through UaEventData::getFieldData().
Examples are
fieldName | Field name constructed by calling UaQualifiedName::toFullString() for the brows name of the event field. If the field is not a direct component of the event type the string is is constructed by the path of browse names seperated with "/". |
OpcUa_UInt32 EventManagerBase::registerEventField | ( | const UaQualifiedNameArray & | path ) | [static] |
Add a custom event field to assign a unique index for selection of the field of the custom type.
The field name is used by the EventManagerBase to verifiy if the client selected event field is valid and to get the unique index for optimized access to the event field through UaEventData::getFieldData().
path | Path of qualified names from the event type to the event field. |
void EventManagerBase::registerEventNotifier | ( | const UaNodeId & | parentNotifier, |
const UaNodeId & | newNotifier | ||
) | [virtual] |
Add an event notifier to the event notifier tree.
Event notifier objects are objects where the EventNotifier attribute is set to SubscribeToEvents. They can be used as nodes in event montitored items. This can be used to limit the events from the monitored item to a specific event notifier or to a part of an event notifier tree.
[in] | parentNotifier | Event notifier used as parent for the new event notifier |
[in] | newNotifier | New event notifier to add to the event notifier tree |
void EventManagerBase::registerEventSource | ( | const UaNodeId & | parentNotifier, |
const UaNodeId & | newSource | ||
) | [virtual] |
Add an event source to the event notifier tree.
Event sources are nodes triggering events through one or more notifier objects. Notifier objects are objects where the EventNotifier attribute is set to SubscribeToEvents. They can be used as nodes in event montitored items. This can be used to limit the events from the monitored item to a specific event notifier or to a part of an event notifier tree. This method is used to register an event source with an event notifier for event filtering.
void EventManagerBase::registerEventType | ( | const UaNodeId & | superType, |
const UaNodeId & | newType | ||
) | [static] |
Adds a custom event type to the event type tree.
[in] | superType | Super type used to add the new type as derived type |
[in] | newType | New type to add to the type tree |
UaStatus EventManagerBase::sendRefreshRequired | ( | OpcUa_UInt32 | hEventItem, |
const UaByteString & | eventId | ||
) | [virtual] |
This method triggers a RefreshRequired event to the clients This event forces the clients to syncronize with the current Condition states by calling ConditionRefresh This method needs to be implemented in every EventManager that is part of a system that provides condition objects. The method is not allowed to be blocked in the EventManager. If the method is called, the EventManager must issue a RefreshStartEventType, must resend the state for any condition where the retain flag is set to true and must send a RefreshEndEventType after the conditions are processed. The refresh start and end events must be sent independent of the number of conditions.
hEventItem | Handle used to identify the EventItem in the EventManager. The handle is provided by the EventManager in the callback EventManagerCallback::finishStartMonitoring. |
eventId | EventId used for the RefreshRequired. All monitored items must use the same EventId for this event. |
Reimplemented from EventManager.
void EventManagerBase::shutDownEM | ( | ) | [virtual] |
Shut down the event manager instance. This disconnects the event manager from all event receivers created with beginStartMonitoring, clears all resources and invalidates the event manager instance.
void EventManagerBase::unregisterEventField | ( | OpcUa_UInt32 | fieldIndex ) | [static] |
Removes a custom event field with the unique index assigned in EventManagerBase::registerEventField().
[in] | fieldIndex | Index assigned in EventManagerBase::registerEventField(). |
void EventManagerBase::unregisterEventNotifier | ( | const UaNodeId & | notifier ) | [virtual] |
Removes an event notifier and all of its notfier children and event sources from the event notifier tree.
[in] | notifier | NodeId of the event notifier used in the event monitored item |
void EventManagerBase::unregisterEventType | ( | const UaNodeId & | typeToRemove ) | [static] |
Removes a custom event type from the event type tree.
[in] | typeToRemove | Type to remove from the type tree |