Interface definition of the EventManager used for monitoring events.
More...
#include <eventmanager.h>
Inherited by EventManagerBase.
|
| EventManager () |
| construction
|
|
virtual | ~EventManager () |
| destruction
|
|
virtual UaStatus | beginEventTransaction (EventManagerCallback *pCallback, const ServiceContext &serviceContext, OpcUa_UInt32 hTransaction, OpcUa_UInt32 totalItemCountHint, EventTransactionType transactionType, OpcUa_Handle &hEventManagerContext)=0 |
| Begins a transaction for modifying the list of event monitored items. More...
|
|
virtual UaStatus | beginStartMonitoring (OpcUa_Handle hEventManagerContext, OpcUa_UInt32 callbackHandle, OpcUa_UInt32 eventManagerIndex, EventCallback *pEventCallback, const EventMonitoringContextCreate &eventMonitoringContext)=0 |
| Start monitoring of an event notifier. More...
|
|
virtual UaStatus | beginModifyMonitoring (OpcUa_Handle hEventManagerContext, OpcUa_UInt32 callbackHandle, OpcUa_UInt32 eventManagerIndex, OpcUa_UInt32 hEventItem, const EventMonitoringContext &eventMonitoringContext)=0 |
| Notify EventManager about modifying monitoring parameters of an event notifier. More...
|
|
virtual UaStatus | beginStopMonitoring (OpcUa_Handle hEventManagerContext, OpcUa_UInt32 callbackHandle, OpcUa_UInt32 eventManagerIndex, OpcUa_UInt32 hEventItem)=0 |
| Notify EventManager about stopping monitoring of an event notifier. More...
|
|
virtual UaStatus | finishEventTransaction (OpcUa_Handle hEventManagerContext)=0 |
| Finishes the transaction for changing the list of event monitored items. More...
|
|
virtual UaStatus | beginConditionRefresh (const ServiceContext &serviceContext, OpcUa_UInt32 hEventItem, const UaByteString &beginEventId, const UaByteString &endEventId) |
| This optional method triggers a refresh for all conditions of interest in the EventManager. More...
|
|
virtual UaStatus | sendRefreshRequired (OpcUa_UInt32 hEventItem, const UaByteString &eventId) |
| This method triggers a RefreshRequired event to the clients This event forces the clients to synchronize 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. More...
|
|
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.
EventTransactionType enumeration.
Enumerator |
---|
MONITOR_BEGIN |
Begin monitoring for a list of data items
|
MONITOR_MODIFY |
Modify monitoring for a list of data items
|
MONITOR_STOP |
Stop monitoring for a list of data items
|
INVALID |
Invalid transaction
|
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.
- Parameters
-
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. |
- Returns
- Result code of the method call
Reimplemented in EventManagerBase.
Begins a transaction for modifying the list of event monitored items.
- Parameters
-
pCallback | Callback interface used for the transaction. The EventManager must use this interface to finish the action for each passed event monitored item in the transaction. The callback interface pointer is valid until the transaction is completely finished. |
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. The Event manager must store this handle and use it in callbacks to EventManagerCallback |
totalItemCountHint | A hint for the EventManager about the total number of monitored items in the transaction. The EventManager may not be responsible for all items but he can use this hint if he wants to optimize memory allocation. |
transactionType | Type of the transaction. The possible enum values are: MONITOR_BEGIN MONITOR_MODIFY MONITOR_STOP |
hEventManagerContext | Handle provided by the EventManager to identify the transaction in the following begin calls. The handle is managed by the EventManager and must be valid until the transaction is completely finished. |
- Returns
- Result code of the method call
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.
- Parameters
-
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. The object is only valid during this method is called. |
- Returns
- Result code of the method call
Implemented in EventManagerBase.
Start monitoring of an event notifier.
- Parameters
-
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 | Callback interface used for event callbacks to the event MonitoredItem managed by the SDK. The callback interface is valid until the monitoring is stopped through beginStopMonitoring. |
eventMonitoringContext | Settings for an event monitored item contained in the EventMonitoringContext class. The object is only valid during this method is called. |
- Returns
- Result code of the method call
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.
- Parameters
-
- Returns
- Result code of the method call
Implemented in EventManagerBase.
virtual UaStatus EventManager::finishEventTransaction |
( |
OpcUa_Handle |
hEventManagerContext | ) |
|
|
pure virtual |
Finishes the transaction for changing the list of event monitored items.
- Parameters
-
hEventManagerContext | Handle of the event transaction. |
- Returns
- Result code of the method call
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 synchronize 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.
- Parameters
-
- Returns
- Result code of the method call
Reimplemented in EventManagerBase.
The documentation for this class was generated from the following files:
- D:/work/uasdkcpp/src/uaserver/uaservercpp/coremodule/eventmanager.h
- D:/work/uasdkcpp/src/uaserver/uaservercpp/coremodule/eventmanagerhelper.cpp