C++ Based OPC UA Client/Server/PubSub SDK  1.7.6.537
UaRelativePath Class Reference

This class manages a relative path used for TranslatBrowsePathsToNodeIds. More...

#include <opcuatypes.h>

Public Member Functions

 UaRelativePath ()
 Creates a UaRelativePath object with an empty path.
 
 UaRelativePath (const OpcUa_RelativePath &relativePath)
 Creates a UaRelativePath object with the passed relative path structure.
 
 UaRelativePath (const UaQualifiedNameArray &browsePath)
 Creates a UaRelativePath object with the passed browse name array. More...
 
 UaRelativePath (const UaRelativePathElements &elements)
 Creates a UaRelativePath object with the passed relative path elements.
 
 UaRelativePath (const UaRelativePath &)
 Creates a UaRelativePath object with the passed other UaRelativePath.
 
virtual ~UaRelativePath ()
 Destroys the UaRelativePath object.
 
void copyTo (OpcUa_RelativePath *pDst) const
 Copy UaRelativePath data to an existing OpcUa_RelativePath structure. More...
 
OpcUa_UInt32 currentPosition () const
 Get the current position in the array of relative path elements. More...
 
bool setCurrentPosition (OpcUa_UInt32 index)
 Set the current position in the list of browse elements. More...
 
OpcUa_UInt32 pathElementCount () const
 Get the total number of RelativePathElements in the array. More...
 
const OpcUa_RelativePathElementgetElementAtCurrentPosition () const
 Get a pointer to the relative path element at the current position in the path. More...
 
const OpcUa_RelativePathElementgetElementAt (OpcUa_UInt32 index) const
 Get a pointer to the relative path element structure at the index passed as parameter. More...
 
void addNodeManagerToProcess (NodeManager *pNodeManager, UaNodeId startingNode, OpcUa_UInt32 indexToContinue)
 Add a NodeManager to the list of NodeManagers to process for the next call to translateBrowsePathToNodeId. More...
 
std::list
< UaTranslateBrowsePathContext * > 
getNodeManagerTranslateContexts () const
 Get a list of all UaTranslateBrowsePathContext that were added before using addNodeManagerToProcess. More...
 
OpcUa_UInt32 numNodeManagerTranslateContexts () const
 Get the total number of UaTranslateBrowsePathContext that were added before using addNodeManagerToProcess. More...
 
void clearNodeManagersToProcess ()
 Delete all objects in the list of NodeManagers to process and cleear the list.
 

Detailed Description

This class manages a relative path used for TranslatBrowsePathsToNodeIds.

The relative path contains a list of path elements where each path element contains the reference type to follow and the browse name of the target node. This path is used to find a target node by starting at a starting node and by following the path. This class manages the relative path and the current position in the path.

To process one element of the path a pointer to the current path element can be requested by using the function getElementAtCurrentPosition(). If the current position contained a valid reference and browse path and a matching node was found at this level, the position will be incremented by the caller (NodeManagerRoot).

To process a several path elements, getElementAt() is used starting from the index provided by currentPosition().

If a NodeManager finds references to another NodeManager it adds those by calling addNodeManagerToProcess().

Constructor & Destructor Documentation

UaRelativePath::UaRelativePath ( const UaQualifiedNameArray browsePath)

Creates a UaRelativePath object with the passed browse name array.

Creates a OpcUa_RelativePathElement array where IncludeSubtypes is true, IsInverse is false and ReferenceTypeId is set to HierarchicalReferences.

Member Function Documentation

void UaRelativePath::addNodeManagerToProcess ( NodeManager pNodeManager,
UaNodeId  startingNode,
OpcUa_UInt32  indexToContinue 
)

Add a NodeManager to the list of NodeManagers to process for the next call to translateBrowsePathToNodeId.

This is needed when a NodeManager processes translateBrowsePathToNodeId and gets to a reference to another NodeManager. The SDK will then call translateBrowsePathToNodeId again for each NodeManager in this list. The objects in the list are deleted by calling clearNodeManagersToProcess in the destructor of this class.

void UaRelativePath::copyTo ( OpcUa_RelativePath pDst) const

Copy UaRelativePath data to an existing OpcUa_RelativePath structure.

Parameters
pDstthe destination of this copy operation.
OpcUa_UInt32 UaRelativePath::currentPosition ( ) const
inline

Get the current position in the array of relative path elements.

Returns
The current position in the list of RelativePathElement as zero based index.
const OpcUa_RelativePathElement * UaRelativePath::getElementAt ( OpcUa_UInt32  index) const

Get a pointer to the relative path element structure at the index passed as parameter.

This method is used if several path elements are processed in a NodeManager. Use UaRelativePath::currentPosition to get the starting index for the processing.

This method returns a null pointer if the index is out of range.

Returns
the relative Path of the Element at index.
const OpcUa_RelativePathElement * UaRelativePath::getElementAtCurrentPosition ( ) const

Get a pointer to the relative path element at the current position in the path.

This method is used if only one path element (the current one) is processed

This function returns a null pointer if the end of the list is reached.

Returns
the relative Path of the current Element.
std::list< UaTranslateBrowsePathContext * > UaRelativePath::getNodeManagerTranslateContexts ( ) const

Get a list of all UaTranslateBrowsePathContext that were added before using addNodeManagerToProcess.

Returns
a list of UaTranslateBrowsePathContext
OpcUa_UInt32 UaRelativePath::numNodeManagerTranslateContexts ( ) const

Get the total number of UaTranslateBrowsePathContext that were added before using addNodeManagerToProcess.

Returns
a list of UaTranslateBrowsePathContext
OpcUa_UInt32 UaRelativePath::pathElementCount ( ) const
inline

Get the total number of RelativePathElements in the array.

Returns
The number of elements.
bool UaRelativePath::setCurrentPosition ( OpcUa_UInt32  index)

Set the current position in the list of browse elements.

This method is only used by internal SDK implementations. Do not use this method in NodeManager implementations.

See also
currentPosition
getCurrentElement
Returns
true if the index is valid. Return flase otherwise

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