C++ Based OPC UA Client/Server SDK  1.5.5.355

Interface class for OPC UA Nodes created and managed with the SDK. More...

#include <uabasenodes.h>

Inherits ChainEntry.

Inherited by UaDataType, UaMethod, UaObject, UaObjectType, UaReferenceType, UaVariable, UaVariableType, and UaView.

Public Member Functions

 UaNode ()
 Construction of the UaNode. More...
 
virtual UaNodeId getKey () const
 Get the key of the node used for the hash table. More...
 
virtual UaReferenceListsgetUaReferenceLists () 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 OpcUa_NodeClass nodeClass () const =0
 Get value of the NodeClass attribute of 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 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...
 
virtual void setUserData (UserDataBase *pUserData)
 Defines the method to set user data handled by a derived class. More...
 
virtual UserDataBasegetUserData () const
 Returns user data provided by a derived class. More...
 
const NodeAccessInfogetAccessInfo () 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
 
ChainEntryfind (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...
 
ChainEntryremove (const UaNodeId &key, ChainEntry **ppNext)
 removes an entry from the list. More...
 
ChainEntrygetNext () const
 Check if there is a chain. More...
 
virtual void setInvalid ()
 Set the entry to invalid. 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 ~UaNode ()
 Destruction of the UaNode. More...
 
- Protected Member Functions inherited from ChainEntry
virtual ~ChainEntry ()
 destruction
 

Detailed Description

Interface class for OPC UA Nodes created and managed with the SDK.

The OPC UA Address Space Model defines a Base NodeClass from which all other NodeClasses are derived. The derived NodeClasses represent the various components of the OPC UA Object Model. The detailed description of the base node class and their attributes can be found in the general description of the Base Node Class.

Constructor & Destructor Documentation

UaNode::~UaNode ( )
protectedvirtual

Destruction of the UaNode.

The object is reference counted and can not be deleted directly. The methods addReference and releaseReference are used to manage the reference to this object.

UaNode::UaNode ( )

Construction of the UaNode.

The object is reference counted and can not be deleted directly. The reference counter is set to one after the object is created. If the object 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 object was not added to a NodeManager, it must be deleted using the releaseReference method. If the interface pointer is used in other places, the availability of the object 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.

Member Function Documentation

void UaNode::attachAccessInfo ( NodeAccessInfo pNodeAccessInfo)

Set the NodeAccessInfo for this node.

Takes the ownership of the NodeAccessInfo and does not increase the reference counter on the NodeAccessInfo argument.

This method can be used if the NodeAccessInfo is created for just this one node.

virtual UaStatus UaNode::browse ( const ServiceContext serviceContext,
BrowseContext browseContext,
UaReferenceDescriptions References 
)
pure virtual

Discover the references of a specified node of a view.

This method is used to return a list of references and target nodes for the passed node to browse for the services Browse and BrowseNext.

Parameters
serviceContextGeneral context for the service calls containing information like the session object, return diagnostic mask and timeout hint.
browseContextBrowse context for the first browse or the following browse with continuation point.
ReferencesArray of ReferenceDescription results for the browsed node.
Returns
Error code

Implemented in UaGenericReferenceType, UaGenericMethod, UaGenericView, UaGenericDataType, UaPropertyMethodArgument, UaViewSimple, UaGenericVariableType, UaMethodGeneric, UaDataVariableDevice, UaGenericVariable, UaDataVariableCache, UaVariableTypeSimple, OpcUa::BaseMethod, UaGenericObjectType, UaObjectBase, OpcUa::BaseObjectType, OpcUa::BaseVariableType, UaObjectTypeSimple, UaGenericObject, UaReferenceTypeNS0, and UaDataTypeNS0.

virtual UaLocalizedText UaNode::description ( Session pSession) const
pure virtual

Get value of the Description attribute of this Node.

Parameters
pSessionInterface to the Session context for the method call. The session provides the locale id requested by the client
Returns
The Description of the node as UaLocalizedText.

Implemented in UaGenericReferenceType, UaGenericMethod, UaGenericView, UaGenericDataType, UaPropertyMethodArgument, UaViewSimple, UaGenericVariableType, UaMethodGeneric, UaDataVariableDevice, UaGenericVariable, UaDataVariableCache, UaVariableTypeSimple, UaGenericObjectType, OpcUa::BaseMethod, UaObjectBase, UaObjectTypeSimple, UaGenericObject, UaReferenceTypeNS0, UaDataTypeNS0, OpcUa::BaseObjectType, and OpcUa::BaseVariableType.

virtual UaLocalizedText UaNode::displayName ( Session pSession) const
pure virtual

Get value of the DisplayName attribute of this Node.

Parameters
pSessionInterface to the Session context for the method call. The session provides the locale id requested by the client
Returns
The DisplayName of the node as UaLocalizedText.

Implemented in UaGenericReferenceType, UaGenericMethod, UaGenericView, UaGenericDataType, UaPropertyMethodArgument, UaViewSimple, UaGenericVariableType, UaMethodGeneric, UaDataVariableDevice, UaGenericVariable, UaDataVariableCache, UaVariableTypeSimple, OpcUa::BaseMethod, UaGenericObjectType, UaObjectBase, UaObjectTypeSimple, OpcUa::BaseObjectType, UaGenericObject, UaReferenceTypeNS0, UaDataTypeNS0, and OpcUa::BaseVariableType.

const NodeAccessInfo * UaNode::getAccessInfo ( ) const

Returns the access info for this node.

Node access info is used for user authorization.

The NodeAccessInfo is reference counted. If the pointer is ues or stored outside, the reference counter must be incremented.

Returning NULL means no access permission is configured for this node.

void UaNode::getAttributeValue ( Session pSession,
OpcUa_Int32  attributeId,
UaDataValue uaDataValue 
)
virtual

Gets the value of an attribute of the Node.

Parameters
[in]pSessionInterface to the Session context for the method call
[in]attributeIdAttribute id indicating the attribute to return
[out]uaDataValueThe value of the attribute or the status code for the attribute

Reimplemented in UaReferenceType, UaMethod, UaView, UaDataType, UaVariableType, UaVariable, UaObjectType, and UaObject.

UaNodeId UaNode::getKey ( ) const
virtual

Get the key of the node used for the hash table.

Returns
The key of the current NodeId.

Implements ChainEntry.

UserDataBase * UaNode::getUserData ( ) const
virtual

Returns user data provided by a derived class.

Returns NULL if not overwritten by a class handling the user data. Can be overwritten by classes providing handling of user data

Reimplemented in OpcUa::BaseMethod, OpcUa::BaseVariableType, and OpcUa::BaseObjectType.

virtual OpcUa_Boolean UaNode::isDescriptionSupported ( ) const
pure virtual
virtual OpcUa_Boolean UaNode::isUserWriteMaskSupported ( ) const
pure virtual
virtual OpcUa_Boolean UaNode::isWriteMaskSupported ( ) const
pure virtual
UaNodeId UaNode::modellingRuleId ( ) const
virtual

Get NodeId of the modeling rule for this node.

Only instance declaration nodes like Objects, Variables or Methods have modeling rules type definition nodes. This method provides a shortcut to get the modeling rule of a node. This information is available for a client by following the HasModellingRule reference (Browse or TranslateBrowsePathToNodeIds) from this node. The HasModellingRule reference is normally not contained in the list of references for the nodes and is handled by the SDK using this method. Creating the reference as normal reference instead of using this shortcut is also possible. The default implementation of this method returns a null NodeId which means there is no modeling rule defined. The method must be overwritten in a derived class to return a modeling rule.

Returns
The modeling rule NodeId for the node if it is an instance declaration node with a modeling rule defined.

Reimplemented in OpcUa::BaseMethod, OpcUa::BaseVariableType, and OpcUa::BaseObjectType.

virtual OpcUa_NodeClass UaNode::nodeClass ( ) const
pure virtual

Get value of the NodeClass attribute of this Node.

Valid values for the node class enumeration are
OpcUa_NodeClass_Object
OpcUa_NodeClass_Variable
OpcUa_NodeClass_Method
OpcUa_NodeClass_ObjectType
OpcUa_NodeClass_VariableType
OpcUa_NodeClass_ReferenceType
OpcUa_NodeClass_DataType
OpcUa_NodeClass_View

Returns
The NodeClass of the current Node.

Implemented in UaGenericReferenceType, UaGenericMethod, UaGenericView, UaReferenceType, UaGenericDataType, UaMethod, UaView, UaDataType, UaGenericVariableType, UaVariableType, UaVariable, UaGenericVariable, UaObjectType, UaVariableTypeSimple, UaObject, UaGenericObjectType, and UaGenericObject.

void UaNode::setAccessInfo ( NodeAccessInfo pNodeAccessInfo)

Set the NodeAccessInfo for this node.

This does not copy the access info; the UaNode just increases the reference counter of NodeAccessInfo.

UaStatus UaNode::setAttributeValue ( Session pSession,
OpcUa_Int32  attributeId,
const UaDataValue dataValue,
OpcUa_Boolean  checkWriteMask 
)
virtual

Sets the value of an attribute of the Node.

Returns
Status code
Parameters
[in]pSessionInterface to the Session context for the method call
[in]attributeIdAttribute id indicating the attribute to set
[in]dataValueNew value for the attribute
[out]checkWriteMaskFlag indicating if the write mask of the node should be checked before setting the new value

Reimplemented in UaGenericReferenceType, UaGenericMethod, UaGenericView, UaGenericDataType, UaGenericVariableType, UaVariable, UaGenericVariable, UaGenericObjectType, OpcUa::BaseMethod, UaGenericObject, OpcUa::BaseVariableType, and OpcUa::BaseObjectType.

void UaNode::setUserData ( UserDataBase pUserData)
virtual

Defines the method to set user data handled by a derived class.

Does not store the user data if not overwritten by a class handling the user data. Can be overwritten by classes providing handling of user data

Parameters
[in]pUserDataUser data to set

Reimplemented in OpcUa::BaseMethod, OpcUa::BaseVariableType, and OpcUa::BaseObjectType.

virtual UaNodeId UaNode::typeDefinitionId ( ) const
inlinevirtual

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 in UaGenericReferenceType, UaGenericMethod, UaGenericView, UaGenericDataType, UaPropertyMethodArgument, UaGenericVariableType, UaPropertyCache, UaGenericVariable, UaAnalogItemCache, UaDataVariableDevice, UaVariableTypeSimple, OpcUa::ConditionTypeBase, UaObjectVendorServerInfo, UaDataVariableCache, UaGenericObjectType, UaObjectServerDiagnostic, OpcUa::AcknowledgeableConditionTypeBase, OpcUa::AlarmConditionTypeBase, UaModelingRule, OpcUa::NonExclusiveLimitAlarmTypeBase, OpcUa::LimitAlarmTypeBase, OpcUa::DialogConditionTypeBase, OpcUa::BaseObjectTypeGeneric, OpcUa::BaseVariableTypeGeneric, UaObjectServerCapabilities, OpcUa::NonExclusiveDeviationAlarmType, OpcUa::ExclusiveLimitAlarmTypeBase, OpcUa::ExclusiveDeviationAlarmType, OpcUa::CertificateExpirationAlarmType, OpcUa::ShelvedStateMachineTypeBase, OpcUa::InitialStateType, OpcUa::NonExclusiveRateOfChangeAlarmType, OpcUa::OffNormalAlarmTypeBase, OpcUa::ExclusiveRateOfChangeAlarmType, OpcUa::NonExclusiveLevelAlarmType, UaGenericObject, OpcUa::FiniteStateMachineType, OpcUa::DataTypeEncodingTypeBase, OpcUa::ProgramStateMachineTypeBase, OpcUa::ExclusiveLevelAlarmType, OpcUa::TripAlarmType, OpcUa::DiscreteAlarmTypeBase, OpcUa::TrustListTypeBase, OpcUa::ExclusiveLimitStateMachineType, OpcUa::SystemOffNormalAlarmType, OpcUa::ArrayItemType, OpcUa::HistoryServerCapabilitiesType, OpcUa::TwoStateVariableType, OpcUa::AddressSpaceFileType, OpcUa::CubeItemType, OpcUa::DataTypeDescriptionType, OpcUa::ImageItemType, OpcUa::NamespaceMetadataType, OpcUa::AnalogItemType, OpcUa::MultiStateDiscreteType, OpcUa::TwoStateDiscreteType, OpcUaDi::DeviceTypeBase, OpcUa::BaseObjectType, OpcUa::FileDirectoryTypeBase, OpcUa::YArrayItemType, OpcUa::MultiStateValueDiscreteType, OpcUa::CertificateGroupType, OpcUa::DataTypeDictionaryType, OpcUa::OptionSetType, OpcUa::XYArrayItemType, OpcUa::NDimensionArrayItemType, OpcUa::ServerConfigurationTypeBase, OpcUa::HistoricalDataConfigurationTypeBase, OpcUa::TransitionVariableType, OpcUa::ProgramDiagnosticType, OpcUa::FiniteTransitionVariableType, OpcUa::DataItemType, OpcUa::BaseDataVariableType, OpcUa::ConditionVariableType, OpcUa::StateVariableType, OpcUa::FileTypeBase, OpcUa::FiniteStateVariableType, OpcUa::CertificateGroupFolderType, OpcUaDi::FunctionalGroupTypeBase, OpcUaDi::TopologyElementTypeBase, OpcUaPlc::CtrlConfigurationTypeBase, OpcUa::TransitionType, OpcUaPlc::CtrlResourceTypeBase, OpcUaDi::NetworkTypeBase, OpcUa::PropertyType, OpcUaDi::BlockTypeBase, OpcUaDi::ConnectionPointTypeBase, OpcUaDi::LockingServicesTypeBase, OpcUa::AggregateConfigurationTypeBase, OpcUa::DiscreteItemType, OpcUaDi::ConfigurableObjectTypeBase, OpcUaPlc::CtrlTaskTypeBase, OpcUa::FolderTypeBase, OpcUaPlc::CtrlConfigurationType, OpcUa::StateMachineType, OpcUaPlc::CtrlFunctionBlockTypeBase, OpcUaPlc::CtrlProgramOrganizationUnitTypeBase, OpcUaPlc::CtrlProgramTypeBase, OpcUaPlc::CtrlResourceType, OpcUa::StateType, UaObjectServer, OpcUaDi::UIElementType, OpcUaPlc::CtrlFunctionBlockType, OpcUaPlc::CtrlProgramType, OpcUaDi::TransferServicesTypeBase, OpcUaDi::ProtocolTypeBase, OpcUaPlc::SFCTypeBase, and UaFolder.

void UaNode::useAccessInfoFrom ( const UaNode pOther)

Set the NodeAccessInfo from another node to this node.

This does not copy the access info, instead both nodes share the same access info by incrementing the reference counter of the NodeAccessInfo.

virtual OpcUa_UInt32 UaNode::userWriteMask ( Session pSession) const
pure virtual

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