C++ Based OPC UA Client/Server SDK  1.5.5.355

Class implementing the reference handling for UaNodes. More...

#include <uabasenodes.h>

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

Public Member Functions

 UaReferenceLists ()
 Constructs the reference lists object.
 
virtual ~UaReferenceLists ()
 Destroys the reference lists object.
 
virtual UaStatus browseReferences (const ServiceContext &serviceContext, BrowseContext &browseContext, UaReferenceDescriptions &References)
 Discover the references of a specified node of a view. More...
 
virtual UaStatus translateBrowsePathToNodeId (const ServiceContext &serviceContext, const UaNodeId &startingNode, UaRelativePath &relativePath, UaBrowsePathTargets &browsePathTargets)
 Find a node based on an element of an relative path. More...
 
virtual const UaReferencepTargetNodes () const
 Returns the list of references to target nodes. More...
 
virtual const UaReferencepSourceNodes () const
 Returns the list of references to source nodes. More...
 
virtual UaNodegetTargetNodeByBrowseName (const UaQualifiedName &browseName) const
 Searches a target node with the passed browse name and returns the UaNode interface if found. More...
 
virtual void addTargetNode (UaReference *pReference)
 Add a reference to a target node where this node is the source node. More...
 
virtual void addSourceNode (UaReference *pReference)
 Adds a reference to a source node where this node is the target node. More...
 
virtual UaStatus removeSourceNode (UaReference *pReferenceToRemove)
 Remove a reference to a source node where this node is the target node. More...
 
virtual bool removeSourceReference (UaReference *pReferenceToRemove)
 Remove the passed reference to a source node. More...
 
virtual UaStatus removeTargetNode (UaNode *pTargetNode, const UaNodeId &referenceTypeId, OpcUa_Boolean deleteBidirectional)
 Remove a reference to a target node where this node is the source node. More...
 
virtual UaStatus removeTargetNode (const UaNodeId &targetNodeId, const UaNodeId &referenceTypeId, OpcUa_Boolean deleteBidirectional)
 Remove a reference to a target node where this node is the source node. More...
 
virtual bool removeTargetReference (UaReference *pReferenceToRemove)
 Remove the passed reference to a target node. More...
 
virtual UaStatus removeCrossNodeManagerRef (NodeManager *pNodeManager)
 Remove references to another NodeManager. More...
 
virtual UaStatus invalidateSourceReferences (OpcUa_Boolean deleteSourceReferences)
 Set all references from SourceNodes to this Node invalid. More...
 
virtual UaStatus invalidateTargetReferences (OpcUa_Boolean deleteTargetReferences)
 Set all references to TargetNode of this node invalid. More...
 
virtual UaStatus deleteAllChildren (NodeManagerConfig *pNodeManagerConfig)
 Deletes all child nodes. More...
 
virtual UaNodegetUaNode () const =0
 Get the UaNode interface pointer of this node. More...
 

Protected Attributes

UaReferencem_pTargetNodes
 List of references to target nodes where this node is the source node. More...
 
UaReferencem_pLastTargetNode
 Last references in the list of references to the target nodes. More...
 
UaReferencem_pSourceNodes
 List of references to source nodes where this node is the target node. More...
 

Detailed Description

Class implementing the reference handling for UaNodes.

Concrete implementation of one of the UaNode interfaces like UaObject or UaVariable can derive from this class to get the default reference handling for UaNodes. This includes adding and removing references, browsing and the implementation of translateBrowsePathToNodeIds.

The class is not thread safe. It is strongly recommended to lock the protected member m_mutexNodes of NodeManagerUaNode if the methods of this class are used directly in the NodeManager. The methods browseReferences and translateBrowsePathToNodeId are using a mutex that is passed in to the serviceContext parameter. This is automatically used by the SDK when using one of the two methods.

Member Function Documentation

void UaReferenceLists::addSourceNode ( UaReference pReference)
virtual

Adds a reference to a source node where this node is the target node.

Parameters
[in]pReferenceA reference to a target node.
void UaReferenceLists::addTargetNode ( UaReference pReference)
virtual

Add a reference to a target node where this node is the source node.

Parameters
[in]pReferenceA reference to a target node.
UaStatus UaReferenceLists::browseReferences ( const ServiceContext serviceContext,
BrowseContext browseContext,
UaReferenceDescriptions References 
)
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.

Returns
Result code for the requested action
Parameters
[in]serviceContextGeneral context for the service calls containing information like the session object, return diagnostic mask and timeout hint.
[in,out]browseContextBrowse context for the first browse or the following browse with continuation point.
[out]ReferencesArray of ReferenceDescription results for the browsed node.
UaStatus UaReferenceLists::deleteAllChildren ( NodeManagerConfig pNodeManagerConfig)
virtual

Deletes all child nodes.

Deletes all child nodes and all references of the nodes to delete. The function follows all forward references that are a subtype of HasChild like HasComponent or HasProperty and deletes the target nodes and all of their references.

Returns
Result code for the requested action
Parameters
[in]pNodeManagerConfigConfig interface of the node manager that owns the nodes to delete.
UaNode * UaReferenceLists::getTargetNodeByBrowseName ( const UaQualifiedName browseName) const
virtual

Searches a target node with the passed browse name and returns the UaNode interface if found.

Returns NULL if the node was not found.

Parameters
[in]browseNameBrowse name of the searched node.
UaStatus UaReferenceLists::invalidateSourceReferences ( OpcUa_Boolean  deleteSourceReferences)
virtual

Set all references from SourceNodes to this Node invalid.

Returns
Result code for the requested action
Parameters
[in]deleteSourceReferencesFlag indicating if the inverse references in the target nodes must be deleted
UaStatus UaReferenceLists::invalidateTargetReferences ( OpcUa_Boolean  deleteTargetReferences)
virtual

Set all references to TargetNode of this node invalid.

Returns
Result code for the requested action
Parameters
[in]deleteTargetReferencesFlag indicating if the inverse references in the target nodes must be deleted
const UaReference * UaReferenceLists::pSourceNodes ( ) const
virtual

Returns the list of references to source nodes.

The returned pointer is null if there are no references. Use UaReference::pNextInverseReference to iterate through the list of inverse references. Do not use the access to this list for any changes. Changes must be executed by using the methods of the class UaReferenceList. Iterating through the list of references is not thread safe. Use the mutex NodeManagerUaNode::m_mutexNodes to lock the access to the list.

const UaReference * UaReferenceLists::pTargetNodes ( ) const
virtual

Returns the list of references to target nodes.

The returned pointer is null if there are no references. Use UaReference::pNextForwardReference to iterate through the list of forward references. Do not use the access to this list for any changes. Changes must be executed by using the methods of the class UaReferenceList. Iterating through the list of references is not thread safe. Use the mutex NodeManagerUaNode::m_mutexNodes to lock the access to the list.

UaStatus UaReferenceLists::removeCrossNodeManagerRef ( NodeManager pNodeManager)
virtual

Remove references to another NodeManager.

Returns
Result code for the requested action
Parameters
[in]pNodeManagerPointer to NodeManager that manages references from the starting node to nodes in the that NodeManager.
UaStatus UaReferenceLists::removeSourceNode ( UaReference pReferenceToRemove)
virtual

Remove a reference to a source node where this node is the target node.

Returns
Result code for the requested action
Parameters
[in]pReferenceToRemoveA reference to a target node to be removed
bool UaReferenceLists::removeSourceReference ( UaReference pReferenceToRemove)
virtual

Remove the passed reference to a source node.

The reference is NOT deleted by this function.

Returns
True if the reference was found and removed from the list. False if the reference was not found
Parameters
[in]pReferenceToRemoveA reference from a source node to be removed
UaStatus UaReferenceLists::removeTargetNode ( UaNode pTargetNode,
const UaNodeId referenceTypeId,
OpcUa_Boolean  deleteBidirectional 
)
virtual

Remove a reference to a target node where this node is the source node.

Returns
Result code for the requested action
Parameters
[in]pTargetNodeThe target node to which the reference should be removed.
[in]referenceTypeIdType of the reference to remove from the source node to the target node.
[in]deleteBidirectionalTRUE if delete bidirectional FALSE if not.
UaStatus UaReferenceLists::removeTargetNode ( const UaNodeId targetNodeId,
const UaNodeId referenceTypeId,
OpcUa_Boolean  deleteBidirectional 
)
virtual

Remove a reference to a target node where this node is the source node.

Returns
Result code for the requested action
Parameters
[in]targetNodeIdThe target node to which the reference should be removed.
[in]referenceTypeIdType of the reference to remove from the source node to the target node.
[in]deleteBidirectionalTRUE if delete bidirectional FALSE if not.
bool UaReferenceLists::removeTargetReference ( UaReference pReferenceToRemove)
virtual

Remove the passed reference to a target node.

The reference is NOT deleted by this function.

Returns
True if the reference was found and removed from the list. False if the reference was not found
Parameters
[in]pReferenceToRemoveA reference to a target node to be removed
UaStatus UaReferenceLists::translateBrowsePathToNodeId ( const ServiceContext serviceContext,
const UaNodeId startingNode,
UaRelativePath relativePath,
UaBrowsePathTargets browsePathTargets 
)
virtual

Find a node based on an element of an relative path.

Returns
Result code for the requested action
Parameters
[in]serviceContextGeneral context for the service calls containing information like the session object, return diagnostic mask and timeout hint.
[in]startingNodeStarting node from where the relative path is defined.
[in,out]relativePathRelative path from the starting node to the searched node.
[out]browsePathTargetsTargets of the Browsepath.

Member Data Documentation

UaReference* UaReferenceLists::m_pLastTargetNode
protected

Last references in the list of references to the target nodes.

UaReference* UaReferenceLists::m_pSourceNodes
protected

List of references to source nodes where this node is the target node.

UaReference* UaReferenceLists::m_pTargetNodes
protected

List of references to target nodes where this node is the source node.


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