C++ Based OPC UA Client/Server/PubSub SDK
1.7.3.505
|
This class manages a relative path used for TranslatBrowsePathsToNodeIds. More...
#include <opcuatypes.h>
Public Member Functions | |
UaRelativePath (const OpcUa_RelativePath &relativePath) | |
construction | |
virtual | ~UaRelativePath () |
destruction | |
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_RelativePathElement * | getElementAtCurrentPosition () const |
Get a pointer to the relative path element at the current position in the path. More... | |
const OpcUa_RelativePathElement * | getElementAt (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. | |
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().
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.
|
inline |
Get the current position in the array of relative path elements.
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.
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.
std::list< UaTranslateBrowsePathContext * > UaRelativePath::getNodeManagerTranslateContexts | ( | ) | const |
Get a list of all UaTranslateBrowsePathContext that were added before using addNodeManagerToProcess.
OpcUa_UInt32 UaRelativePath::numNodeManagerTranslateContexts | ( | ) | const |
Get the total number of UaTranslateBrowsePathContext that were added before using addNodeManagerToProcess.
|
inline |
Get the total number of RelativePathElements in the array.
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.