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.
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.
void UaReferenceLists::addSourceNode |
( |
UaReference * |
pReference | ) |
|
|
virtual |
Adds a reference to a source node where this node is the target node.
- Parameters
-
[in] | pReference | A 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] | pReference | A reference to a target node. |
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] | serviceContext | General context for the service calls containing information like the session object, return diagnostic mask and timeout hint. |
[in,out] | browseContext | Browse context for the first browse or the following browse with continuation point. |
[out] | References | Array of ReferenceDescription results for the browsed node. |
UaStatus UaReferenceLists::collectAllChildrenRecursive |
( |
NodeManagerConfig * |
pNodeManagerConfig, |
|
|
NodesToDeleteCollection & |
nodesToDeleteCollection, |
|
|
int |
recursionCounter = 0 |
|
) |
| |
|
protectedvirtual |
Collect a list of all child nodes.
Collect a list of child nodes.
Follow follows all forward references that are a subtype of HasChild like HasComponent or HasProperty and add them to the collection. This method does not modify the nodes in any way.
- Returns
- Result code for the requested action
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] | pNodeManagerConfig | Config interface of the node manager that owns the nodes to delete. |
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] | browseName | Browse name of the searched node. |
virtual UaNode* UaReferenceLists::getUaNode |
( |
| ) |
const |
|
pure virtual |
Get the UaNode interface pointer of this node.
Implemented in UaGenericReferenceType, UaGenericMethod, UaGenericView, UaGenericDataType, UaPropertyMethodArgument, UaViewSimple, UaGenericVariableType, UaMethodGeneric, UaDataVariableDevice, UaGenericVariable, UaDataVariableCache, UaVariableTypeSimple, UaGenericObjectType, OpcUa::BaseMethod, UaObjectBase, UaReferenceTypeNS0, UaGenericObject, UaDataTypeNS0, UaObjectTypeSimple, OpcUa::BaseVariableType, OpcUa::BaseObjectType, UaObjectServer, and UaFolder.
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] | deleteSourceReferences | Flag 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] | deleteTargetReferences | Flag 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.
Read attributes DisplayName, BrowseName and get the TypeDefinition references.
Remove references to another NodeManager.
- Returns
- Result code for the requested action
- Parameters
-
[in] | pNodeManager | Pointer to NodeManager that manages references from the starting node to nodes in the that NodeManager. |
Remove a reference to a source node where this node is the target node.
- Returns
- Result code for the requested action
- Parameters
-
[in] | pReferenceToRemove | A 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] | pReferenceToRemove | A 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] | pTargetNode | The target node to which the reference should be removed. |
[in] | referenceTypeId | Type of the reference to remove from the source node to the target node. |
[in] | deleteBidirectional | TRUE 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] | targetNodeId | The target node to which the reference should be removed. |
[in] | referenceTypeId | Type of the reference to remove from the source node to the target node. |
[in] | deleteBidirectional | TRUE 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] | pReferenceToRemove | A reference to a target node to be removed |
Find a node based on an element of an relative path.
This method processes only one PathElement in the relativePath even if there is more than one element. This method does not modify the position of the relativePath. If the last element of the relativePath was processed the remainingPathIndex is set to OpcUa_UInt32_Max. Otherwise the remainingPathIndex is set to the index of the next element in relativePath that needs to be processed.
- Returns
- Good if at least one target was found for the current PathElement - otherwise any of the StatusCodes BadNothingToDo, BadBrowseNameInvalid, BadNoMatch.
- Parameters
-
[in] | serviceContext | General context for the service calls containing information like the session object, return diagnostic mask and timeout hint. |
[in] | startingNode | Starting node from where the relative path is defined. |
[in,out] | relativePath | Relative path from the starting node to the searched node. |
[out] | browsePathTargets | Targets of the Browsepath. May contain partial results if only part of the relativePath was processed |
Last references in the list of references to the target nodes.
List of references to source nodes where this node is the target node.
List of references to target nodes where this node is the source node.
The documentation for this class was generated from the following files:
- C:/work/uasdkcpp/src/uaserver/uaservercpp/coremodule/uabasenodes.h
- C:/work/uasdkcpp/src/uaserver/uaservercpp/coremodule/uabasenodes.cpp