C++ Based OPC UA Client/Server SDK
1.5.3.346
|
#include <uadatavariablecache.h>
Inherits UaVariable.
Inherited by OpcUa::BaseVariableType, UaDataVariableCache, UaGenericVariable, and UaPropertyMethodArgument.
Public Member Functions | |
UaVariableCache () | |
Constructes a cache variable with default settings. | |
UaVariableCache (UaMutexRefCounted *pSharedMutex) | |
Constructes a cache variable with default settings using the passed shared mutex. | |
virtual OpcUa_UInt32 | valueHandling () const |
Get the mode for the handling of the value attribute. More... | |
void | addCacheSignal (CacheSignal *pCacheSignal) |
Add a cache item. More... | |
void | removeCacheSignal (CacheSignal *pCacheSignal) |
Remove a cache item. More... | |
void | signalChange () |
Signal change to all cache items. | |
OpcUa_UInt32 | signalCount () |
Get the count of connected monitored items. More... | |
OpcUa_UInt32 | getMinSamplingInterval () |
Get the minimum sampling interval requested. More... | |
VariableHandle * | pVariableHandle () |
Return the VariableHandle for the DataVariable. More... | |
virtual void | setInvalid () |
Set the variable to invalid. More... | |
virtual void | setSharedMutex (UaMutexRefCounted *pSharedMutex) |
Set a shared mutex used for multiple variables to reduce resource consumption. More... | |
UaMutexRefCounted * | getSharedMutex () |
Returns the shared mutex used for multiple variables to reduce resource consumption. | |
void | getHandleIOVariableList (std::list< OpcUa_UInt32 > &handles) |
Returns a list of IOManager handles for the connected IOVariable CacheSignals. More... | |
Public Member Functions inherited from UaVariable | |
UaVariable () | |
construction | |
virtual UaDataValue | value (Session *pSession)=0 |
Returns the value of the Variable. More... | |
virtual UaStatus | setValue (Session *pSession, const UaDataValue &dataValue, OpcUa_Boolean checkAccessLevel=OpcUa_True)=0 |
Sets the value of the Variable. More... | |
virtual UaNodeId | dataType () const =0 |
Get the DataType for the Variable. More... | |
virtual OpcUa_Int32 | valueRank () const =0 |
Get the ValueRank for the Variable. More... | |
virtual OpcUa_Boolean | isArrayDimensionsSupported () const =0 |
Check if the Node is ArrayDimensionsSupported. More... | |
virtual void | arrayDimensions (UaUInt32Array &arrayDimensions) const =0 |
Get the arrayDimensions value for the passed UaNode. More... | |
virtual OpcUa_Byte | accessLevel () const =0 |
Get the AccessLevel for the Variable Value. More... | |
virtual OpcUa_Byte | userAccessLevel (Session *pSession) const =0 |
Get the UserAccessLevel for the Variable. More... | |
virtual OpcUa_Boolean | isMinimumSamplingIntervalSupported () const =0 |
Check whether a minimum sampling interval is supported. More... | |
virtual OpcUa_Double | minimumSamplingInterval () const =0 |
Get the minimum sampling interval of the Variable. More... | |
virtual OpcUa_Boolean | historizing () const =0 |
Indicates if variable value is currently historized or not. More... | |
virtual void | setValueHandling (OpcUa_UInt32 valueHandling) |
Set the mode for the handling of the value attribute. More... | |
OpcUa_NodeClass | nodeClass () const |
Get the NodeClass of the current Node. More... | |
virtual UaStatus | setAttributeValue (Session *pSession, OpcUa_Int32 attributeId, const UaDataValue &dataValue, OpcUa_Boolean checkWriteMask) |
Sets the value of an attribute of the Node. More... | |
virtual void | getAttributeValue (Session *pSession, OpcUa_Int32 attributeId, UaDataValue &uaDataValue) |
Gets the value of an attribute of the Node. More... | |
Public Member Functions inherited from UaNode | |
UaNode () | |
Construction of the UaNode. More... | |
virtual UaNodeId | getKey () const |
Get the key of the node used for the hash table. More... | |
virtual UaReferenceLists * | getUaReferenceLists () const |
Get the UaReferenceLists interface for the node. More... | |
virtual UaStatus | browse (const ServiceContext &serviceContext, BrowseContext &browseContext, UaReferenceDescriptions &References)=0 |
Discover the references of a specified node of a view. More... | |
virtual UaNodeId | typeDefinitionId () const |
Get NodeId of the type definition node for this node. More... | |
virtual UaNodeId | nodeId () const =0 |
Get value of the NodeId attribute of this Node. More... | |
virtual UaQualifiedName | browseName () const =0 |
Get value of the BrowseName attribute of this Node. More... | |
virtual UaLocalizedText | displayName (Session *pSession) const =0 |
Get value of the DisplayName attribute of this Node. More... | |
virtual OpcUa_Boolean | isDescriptionSupported () const =0 |
Flag indicating if the optional attribute Description is supported. More... | |
virtual UaLocalizedText | description (Session *pSession) const =0 |
Get value of the Description attribute of this Node. More... | |
virtual OpcUa_Boolean | isWriteMaskSupported () const =0 |
Flag indicating if the optional attribute WriteMask is supported. More... | |
virtual OpcUa_UInt32 | writeMask () const =0 |
Get value of the WriteMask attribute of this Node. More... | |
virtual OpcUa_Boolean | isUserWriteMaskSupported () const =0 |
Flag indicating if the optional attribute UserWriteMask is supported. More... | |
virtual OpcUa_UInt32 | userWriteMask (Session *pSession) const =0 |
Get value of the UserWriteMask attribute of this Node. More... | |
virtual UaNodeId | modellingRuleId () const |
Get NodeId of the modeling rule for this node. More... | |
virtual void | setUserData (UserDataBase *pUserData) |
Defines the method to set user data handled by a derived class. More... | |
virtual UserDataBase * | getUserData () const |
Returns user data provided by a derived class. More... | |
const NodeAccessInfo * | getAccessInfo () const |
Returns the access info for this node. More... | |
void | useAccessInfoFrom (const UaNode *pOther) |
Set the NodeAccessInfo from another node to this node. More... | |
void | setAccessInfo (NodeAccessInfo *pAccessInfo) |
Set the NodeAccessInfo for this node. More... | |
void | attachAccessInfo (NodeAccessInfo *pAccessInfo) |
Set the NodeAccessInfo for this node. More... | |
Public Member Functions inherited from ChainEntry | |
ChainEntry () | |
construction | |
ChainEntry * | find (const UaNodeId &key, ChainEntry **ppPrevious) |
finds the right entry in the chain. More... | |
void | add (ChainEntry *pNewEntry) |
adds a new entry to the list. More... | |
void | prepend (ChainEntry *pNewEntry) |
prepends a new entry to the list. More... | |
ChainEntry * | remove (const UaNodeId &key, ChainEntry **ppNext) |
removes an entry from the list. More... | |
ChainEntry * | getNext () const |
Check if there is a chain. More... | |
void | clearChain () |
Clear the chain when the hashtable is cleared. | |
Public Member Functions inherited from ReferenceCounter | |
ReferenceCounter () | |
construction | |
virtual | ~ReferenceCounter () |
destruction | |
Protected Member Functions | |
virtual | ~UaVariableCache () |
Destroyes the cache variable object. | |
Protected Member Functions inherited from UaVariable | |
virtual | ~UaVariable () |
destruction | |
Protected Member Functions inherited from UaNode | |
virtual | ~UaNode () |
Destruction of the UaNode. More... | |
Protected Member Functions inherited from ChainEntry | |
virtual | ~ChainEntry () |
destruction | |
Abstract Base Class for UaVariable with a cached value. Derived from UaVariable.
void UaVariableCache::addCacheSignal | ( | CacheSignal * | pCacheSignal | ) |
Add a cache item.
pCacheSignal | a pointer to the Variable pCacheSignal. |
void UaVariableCache::getHandleIOVariableList | ( | std::list< OpcUa_UInt32 > & | handles | ) |
OpcUa_UInt32 UaVariableCache::getMinSamplingInterval | ( | ) |
Get the minimum sampling interval requested.
|
virtual |
Return the VariableHandle for the DataVariable.
Reimplemented from UaVariable.
void UaVariableCache::removeCacheSignal | ( | CacheSignal * | pCacheSignal | ) |
Remove a cache item.
pCacheSignal | a pointer to the Variable pCacheSignal. |
|
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.
Reimplemented in OpcUa::BaseVariableType.
|
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.
OpcUa_UInt32 UaVariableCache::signalCount | ( | ) |
Get the count of connected monitored items.
|
inlinevirtual |
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.
Reimplemented from UaVariable.
Reimplemented in OpcUa::BaseVariableType.