UaVariableCache Class Reference

Abstract Base Class for UaVariable with a cached value. Derived from UaVariable. More...

#include <uadatavariablecache.h>

Inheritance diagram for UaVariableCache:
Collaboration diagram for UaVariableCache:

List of all members.

Public Member Functions

 UaVariableCache ()
 UaVariableCache (UaMutexRefCounted *pSharedMutex)
virtual ~UaVariableCache ()
virtual OpcUa_UInt32 valueHandling () const
void addCacheSignal (CacheSignal *pCacheSignal)
void removeCacheSignal (CacheSignal *pCacheSignal)
void signalChange ()
OpcUa_UInt32 signalCount ()
OpcUa_UInt32 getMinSamplingInterval ()
VariableHandlepVariableHandle ()
virtual void setInvalid ()
virtual void setSharedMutex (UaMutexRefCounted *pSharedMutex)
UaMutexRefCountedgetSharedMutex ()

Protected Attributes

UaMutexRefCountedm_pMutexSignalList

Detailed Description

Abstract Base Class for UaVariable with a cached value. Derived from UaVariable.

UaVariableCache


Constructor & Destructor Documentation

UaVariableCache::UaVariableCache (  )

Constructes a cache variable with default settings

UaVariableCache::UaVariableCache ( UaMutexRefCounted pSharedMutex )

Constructes a cache variable with default settings using the passed shared mutex

UaVariableCache::~UaVariableCache (  ) [virtual]

Destroyes the cache variable object


Member Function Documentation

void UaVariableCache::addCacheSignal ( CacheSignal pCacheSignal )

Add a cache item

Parameters:
pCacheSignala pointer to the Variable pCacheSignal.
OpcUa_UInt32 UaVariableCache::getMinSamplingInterval (  )

Get the minimum sampling interval requested

Returns:
the minimum sampling interval requested
UaMutexRefCounted * UaVariableCache::getSharedMutex (  )

Returns the shared mutex used for multiple variables to reduce resource consumption.

VariableHandle * UaVariableCache::pVariableHandle (  ) [virtual]

Return the VariableHandle for the DataVariable.

Returns:
the VariableHandle for the DataVariable.

Reimplemented from UaVariable.

void UaVariableCache::removeCacheSignal ( CacheSignal pCacheSignal )

Remove a cache item

Parameters:
pCacheSignala pointer to the Variable pCacheSignal.
void UaVariableCache::setInvalid (  ) [virtual]

Set the variable to invalid. This method can be overwritten by a derived class to set the internal state to invalid until the object gets deleted when the reference count goes to zero. This method is used if the object should be invalidated but can not be deleted since the lifetime is controlled by the reference count.

Reimplemented from ChainEntry.

void UaVariableCache::setSharedMutex ( UaMutexRefCounted pSharedMutex ) [virtual]

Set a shared mutex used for multiple variables to reduce resource consumption. A mutex is a system object that uses limited resources. Since a large number of variables can be created in a server this function allows to set a mutex after the creation of the object that is shared across multiple Variable instances.

void UaVariableCache::signalChange (  )

Signal change to all cache items

OpcUa_UInt32 UaVariableCache::signalCount (  )

Get a count of signal items

Returns:
a count of signal items
virtual OpcUa_UInt32 UaVariableCache::valueHandling (  ) const [inline, virtual]

Get the mode for the handling of the value attribute.
The value is a bit mask with the following values
UaVariable_Value_None = 0x0 - There is no value stored in the variable. The access to the value attribute must be implemented by the user of the SDK
UaVariable_Value_Cache = 0x1 - The variable has a cached value but normal read and data monitoring will not use the value directly. If only this flag is set all read and sampling access uses IOManagerUaNode::readValues that needs to be implemented in the custom NodeManager. All write operations to this variable are using IOManagerUaNode::writeValues. The cache value is not updated by the SDK. The custom code is responsible for updating the cache to allow the SDK to return values that are not older than the MaxAge parameter in the Read.
UaVariable_Value_CacheIsSource = 0x2 - If this flag is set, the value in the variable node is the data source and all read, data monitoring and write operations are using the value without requiring any custom code. Value changes can be provided with the method UaVariable::setValue(). IOManagerUaNode::beforeSetAttributeValue and IOManagerUaNode::afterSetAttributeValue can be used to control writing of attributes or to get informed about a successful write of an attribute. This requires overwriting these functions in the custom NodeManager implementation class.
UaVariable_Value_CacheIsUpdatedOnRequest = 0x4 - If this flag is set, the custom code is responsible for updating the cache value for variables monitored by one or more clients and to handle read and write operations. Value changes can be provided with the method UaVariable::setValue(). The custom code gets informed about monitoring changes for items of this type by overwriting IOManagerUaNode::variableCacheMonitoringChanged in the custom NodeManager implementation. In addition it is required to implement IOManagerUaNode::readValues and IOManagerUaNode::writeValues for read and write operations. This option allows optimizing cyclic access to devices for data monitoring independent of read operations.

Returns:
The mode for the handling of the Value attribute.

Reimplemented from UaVariable.

Reimplemented in OpcUa::BaseVariableType.


Member Data Documentation


The documentation for this class was generated from the following files:
  • /home/buildbot/work/uasdkcpp/src/uaserver/uaservercpp/coremodule/uadatavariablecache.h
  • /home/buildbot/work/uasdkcpp/src/uaserver/uaservercpp/coremodule/uadatavariablecache.cpp