OpcUa::BaseVariableTypeGeneric Class Reference

#include <opcua_basevariabletype.h>

Inheritance diagram for OpcUa::BaseVariableTypeGeneric:
Collaboration diagram for OpcUa::BaseVariableTypeGeneric:

List of all members.

Public Member Functions

 BaseVariableTypeGeneric (UaNode *pParentNode, UaVariable *pInstanceDeclarationVariable, NodeManagerConfig *pNodeConfig, UaMutexRefCounted *pSharedMutex=NULL)
 BaseVariableTypeGeneric (const UaNodeId &nodeId, const UaString &name, OpcUa_UInt16 browseNameNameSpaceIndex, const UaVariant &initialValue, OpcUa_Byte accessLevel, NodeManagerConfig *pNodeConfig, UaMutexRefCounted *pSharedMutex=NULL)
virtual ~BaseVariableTypeGeneric ()
virtual UaNodeId typeDefinitionId () const
virtual void setTypeDefinitionId (const UaNodeId &typeDefinitionId)

Detailed Description

Base class for representing UA Variables of any type definition. The type definition NodeId can be set on instances of this class to represent an OPC UA variable of any type.


Constructor & Destructor Documentation

OpcUa::BaseVariableTypeGeneric::BaseVariableTypeGeneric ( UaNode pParentNode,
UaVariable pInstanceDeclarationVariable,
NodeManagerConfig pNodeConfig,
UaMutexRefCounted pSharedMutex = NULL 
)

Constructs an instance of the class BaseVariableTypeGeneric based on an instance declaration variable.

This constructor is used if the variable is created based on an instance declaration of an object or variable type. Since the only difference between the instance declaration variable and the instance variable are the NodeId and the Value, the pointer to the instance declaration node is used to get the attribute values other than the attributes NodeId and Value from the instance declaration node.
The variable is reference counted and can not be deleted directly. The reference counter is set to one after the variable is created. If the variable was successfully added to a NodeManager using the methods NodeManagerConfig::addUaNode or NodeManagerConfig::addNodeAndReference the NodeManager will release this reference during shut down. If the variable was not added to a NodeManager, it must be deleted using the releaseReference method. If the interface pointer is used in other places, the availablity of the variable must be ensured by incrementing the reference counter with addReference when the pointer is stored somewhere and decremented with releaseReference if the interface pointer is not longer needed.

Parameters:
[in]pParentNodeParent node of the new variable
[in]pInstanceDeclarationVariableUaVariable interface of the instance declaration node used to provide attribute values other than NodeId and Value
[in]pNodeConfigInterface pointer to the NodeManagerConfig interface used to add and delete node and references in the address space
[in]pSharedMutexShared mutex object used to synchronize access to the variable. Can be NULL if no shared mutex is provided
OpcUa::BaseVariableTypeGeneric::BaseVariableTypeGeneric ( const UaNodeId nodeId,
const UaString name,
OpcUa_UInt16  browseNameNameSpaceIndex,
const UaVariant initialValue,
OpcUa_Byte  accessLevel,
NodeManagerConfig pNodeConfig,
UaMutexRefCounted pSharedMutex = NULL 
)

Constructs an instance of the class BaseVariableTypeGeneric with the passed attribute values.

This constructor is used if the variable is not created based on an instance declaration. It defines the name, nodeId, initial value and access level of the variable. Additional language specific names and other attribute values can be set with set methods provided by the class. The variable is reference counted and can not be deleted directly. The reference counter is set to one after the variable is created. If the variable was successfully added to a NodeManager using the methods NodeManagerConfig::addUaNode or NodeManagerConfig::addNodeAndReference the NodeManager will release this reference during shut down. If the variable was not added to a NodeManager, it must be deleted using the releaseReference method. If the interface pointer is used in other places, the availablity of the variable must be ensured by incrementing the reference counter with addReference when the pointer is stored somewhere and decremented with releaseReference if the interface pointer is not longer needed.

Parameters:
[in]nodeIdNodeId of the new variable
[in]nameName of the new variable. Used as browse name and also as display name if no additional language specific names are set.
[in]browseNameNameSpaceIndexNamespace index used for the browse name
[in]initialValueInitial value for the Variable
[in]accessLevelAccess level for the Variable
[in]pNodeConfigInterface pointer to the NodeManagerConfig interface used to add and delete node and references in the address space
[in]pSharedMutexShared mutex object used to synchronize access to the variable. Can be NULL if no shared mutex is provided
OpcUa::BaseVariableTypeGeneric::~BaseVariableTypeGeneric (  ) [virtual]

Destroys the BaseVariableTypeGeneric instance


Member Function Documentation

void OpcUa::BaseVariableTypeGeneric::setTypeDefinitionId ( const UaNodeId typeDefinitionId ) [virtual]

Sets the type definition NodeId on the instances of this class to represent an OPC UA variable of any type.

UaNodeId OpcUa::BaseVariableTypeGeneric::typeDefinitionId (  ) const [virtual]

Get NodeId of the type definition node for this node. Only Object and Variable nodes have type definition nodes. This method provides a shortcut to get the type definition of a node. This information is available for a client by following the HasTypeDefinition reference (Browse or TranslateBrowsePathToNodeIds) from this node or is returned as part of the browse result for the node. The HasTypeDefinition reference is not contained in the list of references for the nodes and is handled by the SDK using this method.

Returns:
The type definition NodeId of the node if the node is a Variable or Object.

Reimplemented from UaNode.


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