#include <eventmanager.h>
Public Member Functions | |
EventManager () | |
construction | |
virtual | ~EventManager () |
destruction | |
virtual UaStatus | beginEventTransaction (EventManagerCallback *pCallback, const ServiceContext &serviceContext, OpcUa_UInt32 hTransaction, OpcUa_Handle &hEventManagerContext)=0 |
virtual UaStatus | beginStartMonitoring (OpcUa_Handle hEventManagerContext, OpcUa_UInt32 callbackHandle, OpcUa_UInt32 eventManagerIndex, EventCallback *pEventCallback, const EventMonitoringContextCreate &eventMonitoringContext)=0 |
virtual UaStatus | beginModifyMonitoring (OpcUa_Handle hEventManagerContext, OpcUa_UInt32 callbackHandle, OpcUa_UInt32 eventManagerIndex, OpcUa_UInt32 hEventItem, const EventMonitoringContext &eventMonitoringContext)=0 |
virtual UaStatus | beginStopMonitoring (OpcUa_Handle hEventManagerContext, OpcUa_UInt32 callbackHandle, OpcUa_UInt32 eventManagerIndex, OpcUa_UInt32 hEventItem)=0 |
virtual UaStatus | finishEventTransaction (OpcUa_Handle hEventManagerContext)=0 |
virtual UaStatus | beginConditionRefresh (const ServiceContext &serviceContext, OpcUa_UInt32 hEventItem, const UaByteString &beginEventId, const UaByteString &endEventId) |
virtual UaStatus | sendRefreshRequired (OpcUa_UInt32 hEventItem, const UaByteString &eventId) |
Interface definition of the EventManager used for monitoring events. The EventManager interface provides the monitoring capabilities for object notifiers. The EventManager interface is asynchronous. For the EventManager callback the EventManagerCallback interface is implemented by the consumer of the events. One of the consumers is the UA Module. This interface is used by the SDK to multiplex the list of event monitored items in the UA service call to different EventManager. One UA service call is a transaction for the SDK. If an EventManager is used in a transaction, the beginEventTransaction method is called by the SDK. This allows the EventManager to create a context for the transactions since the SDK will call the associated begin method (e.g. beginStartMonitoring) for each monitored item in the transaction. Depending on the underlying system, the action can be started for each monitored item in the begin method or for a list of monitored items in the finishEventTransaction method. If the underlying system allows optimizing access for a list of monitored items, the finishEventTransaction method should be used to start the access to the underlying system. This method is called by the SDK after calling the begin methods for all monitored items in the transaction.
UaStatus EventManager::beginConditionRefresh | ( | const ServiceContext & | serviceContext, |
OpcUa_UInt32 | hEventItem, | ||
const UaByteString & | beginEventId, | ||
const UaByteString & | endEventId | ||
) | [virtual] |
This optional method triggers a refresh for all conditions of interest in the EventManager. Conditions of interest have the Retain flag set to true. This method needs to be implemented if the EventManager provides access to condition objects. The method is not allowed to be blocked in the EventManager. The actual refresh must be executed in a worker thread. 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.
serviceContext | General context for the service calls containing information like the session object, return diagnostic mask and timeout hint. |
hEventItem | Handle used to identify the EventItem in the EventManager. The handle is provided by the EventManager in the callback EventManagerCallback::finishStartMonitoring. |
beginEventId | EventId used for the RefreshStartEvent. All monitored items must use the same EventId for this event. The RefreshStartEvent is only sent if the beginEventId is not NULL. |
endEventId | EventId used for the RefreshEndEvent. All monitored items must use the same EventId for this event. The RefreshEndEvent is only sent if the endEventId is not NULL. |
Reimplemented in EventManagerBase.
virtual UaStatus EventManager::beginEventTransaction | ( | EventManagerCallback * | pCallback, |
const ServiceContext & | serviceContext, | ||
OpcUa_UInt32 | hTransaction, | ||
OpcUa_Handle & | hEventManagerContext | ||
) | [pure virtual] |
Start a transaction.
pCallback | Callback 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 | Handle provided by the EventManager to identify the transaction in the following begin calls. |
Implemented in EventManagerBase.
virtual UaStatus EventManager::beginModifyMonitoring | ( | OpcUa_Handle | hEventManagerContext, |
OpcUa_UInt32 | callbackHandle, | ||
OpcUa_UInt32 | eventManagerIndex, | ||
OpcUa_UInt32 | hEventItem, | ||
const EventMonitoringContext & | eventMonitoringContext | ||
) | [pure virtual] |
Notify EventManager about modifying monitoring parameters of an event notifier.
hEventManagerContext | Handle provided by the EventManager in beginEventTransaction used to identify the transaction context for this call. |
callbackHandle | Handle for the item in the callback. |
eventManagerIndex | Index of the EventManager that needs to be passed to the callback function. |
hEventItem | Handle used to identify the EventItem in the EventManager. The handle is provided by the EventManager in the callback EventManagerCallback::finishStartMonitoring. |
eventMonitoringContext | Settings for an event monitored item contained in the EventMonitoringContext class. |
Implemented in EventManagerBase.
virtual UaStatus EventManager::beginStartMonitoring | ( | OpcUa_Handle | hEventManagerContext, |
OpcUa_UInt32 | callbackHandle, | ||
OpcUa_UInt32 | eventManagerIndex, | ||
EventCallback * | pEventCallback, | ||
const EventMonitoringContextCreate & | eventMonitoringContext | ||
) | [pure virtual] |
Start monitoring of an event notifier.
hEventManagerContext | Handle provided by the EventManager in beginEventTransaction used to identify the transaction context for this call. |
callbackHandle | Handle for the item in the callback. |
eventManagerIndex | Index of the EventManager that needs to be passed to the callback function. |
pEventCallback | the callback Event of the actual used monitored Item. |
eventMonitoringContext | Settings for an event monitored item contained in the EventMonitoringContext class. |
Implemented in EventManagerBase.
virtual UaStatus EventManager::beginStopMonitoring | ( | OpcUa_Handle | hEventManagerContext, |
OpcUa_UInt32 | callbackHandle, | ||
OpcUa_UInt32 | eventManagerIndex, | ||
OpcUa_UInt32 | hEventItem | ||
) | [pure virtual] |
Notify EventManager about stopping monitoring of an event notifier.
hEventManagerContext | Handle provided by the EventManager in beginEventTransaction used to identify the transaction context for this call. |
callbackHandle | Handle for the item in the callback. |
eventManagerIndex | Index of the EventManager that needs to be passed to the callback function. |
hEventItem | Handle used to identify the EventItem in the EventManager. The handle is provided by the EventManager in the callback EventManagerCallback::finishStartMonitoring. |
Implemented in EventManagerBase.
virtual UaStatus EventManager::finishEventTransaction | ( | OpcUa_Handle | hEventManagerContext ) | [pure virtual] |
Finish a transaction.
hEventManagerContext | a Variable with all information about the current context. |
Implemented in EventManagerBase.
UaStatus EventManager::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 in EventManagerBase.