C++ Based OPC UA Client/Server SDK  1.5.3.346
EventManager Class Referenceabstract

Interface definition of the EventManager used for monitoring events. More...

#include <eventmanager.h>

Inherited by EventManagerBase.

Public Types

enum  EventTransactionType { MONITOR_BEGIN, MONITOR_MODIFY, MONITOR_STOP, INVALID }
 EventTransactionType enumeration. More...
 

Public Member Functions

 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...
 

Detailed Description

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.

Member Function Documentation

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.

Parameters
serviceContextGeneral context for the service calls containing information like the session object, return diagnostic mask and timeout hint.
hEventItemHandle used to identify the EventItem in the EventManager. The handle is provided by the EventManager in the callback EventManagerCallback::finishStartMonitoring.
beginEventIdEventId 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.
endEventIdEventId 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.

virtual UaStatus EventManager::beginEventTransaction ( EventManagerCallback pCallback,
const ServiceContext serviceContext,
OpcUa_UInt32  hTransaction,
OpcUa_UInt32  totalItemCountHint,
EventTransactionType  transactionType,
OpcUa_Handle &  hEventManagerContext 
)
pure virtual

Begins a transaction for modifying the list of event monitored items.

Parameters
pCallbackCallback 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.
serviceContextGeneral context for the service calls containing information like the session object, return diagnostic mask and timeout hint.
hTransactionHandle 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
totalItemCountHintA 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.
transactionTypeType of the transaction. The possible enum values are: MONITOR_BEGIN MONITOR_MODIFY MONITOR_STOP
hEventManagerContextHandle 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.

If this method or the finishModifyMonitoring callback returns an error for a valid event item in the EventManager, the EventManager must suspend the event item until another modify succeeds or until it is removed.

Parameters
hEventManagerContextHandle provided by the EventManager in beginEventTransaction used to identify the transaction context for this call.
callbackHandleHandle for the item in the callback.
eventManagerIndexIndex of the EventManager that needs to be passed to the callback function.
hEventItemHandle used to identify the EventItem in the EventManager. The handle is provided by the EventManager in the callback EventManagerCallback::finishStartMonitoring.
eventMonitoringContextSettings 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::beginStartMonitoring ( OpcUa_Handle  hEventManagerContext,
OpcUa_UInt32  callbackHandle,
OpcUa_UInt32  eventManagerIndex,
EventCallback pEventCallback,
const EventMonitoringContextCreate eventMonitoringContext 
)
pure virtual

Start monitoring of an event notifier.

Parameters
hEventManagerContextHandle provided by the EventManager in beginEventTransaction used to identify the transaction context for this call.
callbackHandleHandle for the item in the callback.
eventManagerIndexIndex of the EventManager that needs to be passed to the callback function.
pEventCallbackCallback 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.
eventMonitoringContextSettings 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
hEventManagerContextHandle provided by the EventManager in beginEventTransaction used to identify the transaction context for this call.
callbackHandleHandle for the item in the callback.
eventManagerIndexIndex of the EventManager that needs to be passed to the callback function.
hEventItemHandle used to identify the EventItem in the EventManager. The handle is provided by the EventManager in the callback EventManagerCallback::finishStartMonitoring.
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
hEventManagerContextHandle 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
hEventItemHandle used to identify the EventItem in the EventManager. The handle is provided by the EventManager in the callback EventManagerCallback::finishStartMonitoring.
eventIdEventId used for the RefreshRequired. All monitored items must use the same EventId for this event.
Returns
Result code of the method call

Reimplemented in EventManagerBase.


The documentation for this class was generated from the following files: