IOManager Class Reference
[Core Module Interfaces]

#include <iomanager.h>

Inheritance diagram for IOManager:

List of all members.


Public Types

enum  TransactionType {
  READ, WRITE, MONITOR_BEGIN, MONITOR_MODIFY,
  MONITOR_STOP, INVALID
}

Public Member Functions

 IOManager ()
virtual ~IOManager ()
virtual UaStatus beginTransaction (IOManagerCallback *pCallback, const ServiceContext &serviceContext, OpcUa_UInt32 hTransaction, OpcUa_UInt32 totalItemCountHint, OpcUa_Double maxAge, OpcUa_TimestampsToReturn timestampsToReturn, TransactionType transactionType, OpcUa_Handle &hIOManagerContext)=0
virtual UaStatus beginStartMonitoring (OpcUa_Handle hIOManagerContext, OpcUa_UInt32 callbackHandle, IOVariableCallback *pIOVariableCallback, VariableHandle *pVariableHandle, MonitoringContext &monitoringContext)=0
virtual UaStatus beginModifyMonitoring (OpcUa_Handle hIOManagerContext, OpcUa_UInt32 callbackHandle, OpcUa_UInt32 hIOVariable, MonitoringContext &monitoringContext)=0
virtual UaStatus beginStopMonitoring (OpcUa_Handle hIOManagerContext, OpcUa_UInt32 callbackHandle, OpcUa_UInt32 hIOVariable)=0
virtual UaStatus beginRead (OpcUa_Handle hIOManagerContext, OpcUa_UInt32 callbackHandle, VariableHandle *pVariableHandle, OpcUa_ReadValueId *pReadValueId)=0
virtual UaStatus beginWrite (OpcUa_Handle hIOManagerContext, OpcUa_UInt32 callbackHandle, VariableHandle *pVariableHandle, OpcUa_WriteValue *pWriteValue)=0
virtual UaStatus finishTransaction (OpcUa_Handle hIOManagerContext)=0

Detailed Description

Interface definition of the IOManager used for reading, writing and monitoring data. The IOManager interface provides the reading, writing and monitoring capabilities for node attributes. The IOManager interface is asynchronous. For the IOManager callback the IOManagerCallback interface is implemented by the consumer of the attribute data. One of the consumers is the UA Module. This interface is used by the SDK to multiplex the list of nodes in the UA service call to different IOManagers. One UA service call is a transaction for the SDK. If an IOManager is used in a transaction, the beginTransaction method is called by the SDK. This allows the IOManager to create a context for the transactions since the SDK will call the associated begin method (e.g. beginRead for the UA Read service) for each node in the transaction. Depending on the underlying system, the action can be started for each node in the begin method or for a list of nodes in the finishTransaction method. If the underlying system allows optimizing access for a list of nodes, the finishTransaction 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 nodes in the transaction.

Member Enumeration Documentation

TransactionType enumeration

Enumerator:
READ  TransactionType: Read
WRITE  TransactionType: Write
MONITOR_BEGIN  TransactionType: Monitor_Begin
MONITOR_MODIFY  TransactionType: Monitor_Modify
MONITOR_STOP  TransactionType: Monitor_Stop
INVALID  TransactionType: Invalid


Constructor & Destructor Documentation

IOManager::IOManager (  )  [inline]

Construction

virtual IOManager::~IOManager (  )  [inline, virtual]

Destruction


Member Function Documentation

virtual UaStatus IOManager::beginTransaction ( IOManagerCallback pCallback,
const ServiceContext serviceContext,
OpcUa_UInt32  hTransaction,
OpcUa_UInt32  totalItemCountHint,
OpcUa_Double  maxAge,
OpcUa_TimestampsToReturn  timestampsToReturn,
TransactionType  transactionType,
OpcUa_Handle &  hIOManagerContext 
) [pure virtual]

Begin a IOManager transaction. Is called by the SDK before the first begin method call for a transaction. This method must create a context in the IOManager for the transaction.

Parameters:
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 Service context including the session context used for the UA service call.
hTransaction Handle for the transaction used by the SDK to identify the transaction in the callbacks.
totalItemCountHint A hint for the IOManager about the total number of nodes in the transaction. The IOManager may not be responsible for all nodes but he can use this hint if he wants to optimize memory allocation.
maxAge Max age parameter used only in the Read service.
timestampsToReturn Indicates which timestamps should be returned in a Read or a Publish response. The possible enum values are: OpcUa_TimestampsToReturn_Source OpcUa_TimestampsToReturn_Server OpcUa_TimestampsToReturn_Both OpcUa_TimestampsToReturn_Neither
transactionType Type of the transaction. The possible enum values are: READ WRITE MONITOR_BEGIN MONITOR_MODIFY MONITOR_STOP
hIOManagerContext Handle to the context in the IOManager for the transaction. This handle is passed into the IOManager begin methods to identify the transaction context in the IOManager.
Returns:
Error code

Implemented in IOManagerUaNode.

virtual UaStatus IOManager::beginStartMonitoring ( OpcUa_Handle  hIOManagerContext,
OpcUa_UInt32  callbackHandle,
IOVariableCallback pIOVariableCallback,
VariableHandle pVariableHandle,
MonitoringContext monitoringContext 
) [pure virtual]

Begin start monitoring of an item. Is called by the SDK for each node in a UA CreateMonitoredItems service call if sampling is enabled or for service calls enabling the sampling for a monitored item. It is expected that this method does not block for external communication with the underlying system. See also beginRead description for more details. The corresponding callback method is the finishStartMonitoring method.

Parameters:
hIOManagerContext IOManager handle for the transaction context. This handle is used to identify the transaction in the IOManager.
callbackHandle Handle for the node in the callback.
pIOVariableCallback Callback interface used for data change callbacks to the MonitoredItem managed by the SDK.
pVariableHandle Variable handle provided by the NodeManager::getVariableHandle. This object contains the information needed by the IOManager to identify the node to read in its context.
monitoringContext handle for the monitoring context.
Returns:
Error code

Implemented in IOManagerUaNode.

virtual UaStatus IOManager::beginModifyMonitoring ( OpcUa_Handle  hIOManagerContext,
OpcUa_UInt32  callbackHandle,
OpcUa_UInt32  hIOVariable,
MonitoringContext monitoringContext 
) [pure virtual]

Begin modify monitoring of an item. Is called by the SDK for each node in a UA ModifyMonitoredItems service call. It is expected that this method does not block for external communication with the underlying system. See also beginRead description for more details. The corresponding callback method is the finishModifyMonitoring method.

Parameters:
hIOManagerContext IOManager handle for the transaction context. This handle is used to identify the transaction in the IOManager.
callbackHandle Handle for the node in the callback.
hIOVariable The handle of the variable in the IOManager created with beginStartMonitoring. The handle was passed to the SDK in the callback finishStartMonitoring.
monitoringContext handle for the monitoring context.
Returns:
Error code

Implemented in IOManagerUaNode.

virtual UaStatus IOManager::beginStopMonitoring ( OpcUa_Handle  hIOManagerContext,
OpcUa_UInt32  callbackHandle,
OpcUa_UInt32  hIOVariable 
) [pure virtual]

Begin stop monitoring of an item. Is called by the SDK for each node in a UA DeleteMonitoredItems service call if sampling is enabled for the monitored item to delete or for service calls disabling the sampling for a monitored item. It is expected that this method does not block for external communication with the underlying system. See also beginRead description for more details. The corresponding callback method is the finishStopMonitoring method.

Parameters:
hIOManagerContext IOManager handle for the transaction context. This handle is used to identify the transaction in the IOManager.
callbackHandle Handle for the node in the callback.
hIOVariable The handle of the variable in the IOManager created with beginStartMonitoring. The handle was passed to the SDK in the callback finishStartMonitoring.
Returns:
Error code

Implemented in IOManagerUaNode.

virtual UaStatus IOManager::beginRead ( OpcUa_Handle  hIOManagerContext,
OpcUa_UInt32  callbackHandle,
VariableHandle pVariableHandle,
OpcUa_ReadValueId *  pReadValueId 
) [pure virtual]

Begin reading an attribute value of a node. Is called by the SDK for each node in a UA Read service call. It is expected that this method does not block for external communication with the underlying system. If the read can be done inside the local process memory, the read can be executed and the finishRead method can be called inside this method call. If the underlying system is able to queue the read for the node without blocking for external communication, the beginRead can queue the node in the underlying system. If the communication with the underlying system can block, the node must be stored in the context of the transaction and the communication with the underlying system must be started asynchronous in the finishTransaction method. The corresponding callback method is the finishRead method.

Parameters:
hIOManagerContext IOManager handle for the transaction context. This handle is used to identify the transaction in the IOManager.
callbackHandle Handle for the node in the callback.
pVariableHandle Variable handle provided by the NodeManager::getVariableHandle. This object contains the information needed by the IOManager to identify the node to read in its context.
pReadValueId Context for the node to read. The context contains the IndexRange and the DataEncoding requested by the client. The other parameters of this context are already handled by the VariableHandle.
Returns:
Error code

Implemented in IOManagerUaNode.

virtual UaStatus IOManager::beginWrite ( OpcUa_Handle  hIOManagerContext,
OpcUa_UInt32  callbackHandle,
VariableHandle pVariableHandle,
OpcUa_WriteValue *  pWriteValue 
) [pure virtual]

Begin writing an attribute value for a node. Is called by the SDK for each node in a UA Write service call. It is expected that this method does not block for external communication with the underlying system. See also beginRead description for more details. The corresponding callback method is the finishWrite method.

Parameters:
hIOManagerContext IOManager handle for the transaction context. This handle is used to identify the transaction in the IOManager.
callbackHandle Handle for the node in the callback.
pVariableHandle Variable handle provided by the NodeManager::getVariableHandle. This object contains the information needed by the IOManager to identify the node in its context.
pWriteValue Context for the node to write. The context contains the IndexRange requested by the client. The NodeId and Attribute parameters of this context are already handled by the VariableHandle
Returns:
Error code

Implemented in IOManagerUaNode.

virtual UaStatus IOManager::finishTransaction ( OpcUa_Handle  hIOManagerContext  )  [pure virtual]

Finish a transaction. Is called by the SDK after the last begin method call for a transaction. If the nodes for the transaction are stored in the transaction context and the access to the underlying system is done in the finishTransaction, this access must be done asynchronous like in an own worker thread. It is expected that this method does not block for external communication with the underlying system. After finishing the communication with the underlying system, the corresponding finish callback methods of the interface IOManagerCallback can be called for each node in the transaction

Parameters:
hIOManagerContext IOManager handle for the transaction context. This handle is used to identify the transaction to finish in the IOManager.
Returns:
Error code

Implemented in IOManagerUaNode.


The documentation for this class was generated from the following file:
  • src/uaserver/uaservercpp/coremodule/iomanager.h