#include <nodemanageruanode.h>

Inheritance diagram for NodeManagerUaNode:
Collaboration diagram for NodeManagerUaNode:

List of all members.

Public Member Functions

 NodeManagerUaNode (const UaString &sNamespaceUri, OpcUa_Int32 nHashTableSize)
virtual ~NodeManagerUaNode ()
virtual UaStatus afterStartUp ()=0
virtual UaStatus beforeShutDown ()=0
virtual UaNodegetNode (const UaNodeId &nodeId)
virtual IOManagergetIOManager (UaNode *pUaNode, OpcUa_Int32 attributeId) const =0
void registerBrowseUaNodeCallback (BrowseUaNodeCallback *pBrowseUaNodeCallback)
UaStatus addUaNode (UaNode *pNewNode)
UaStatus deleteUaNode (UaNode *pNode, OpcUa_Boolean deleteTargetReferences, OpcUa_Boolean deleteSourceReferences=OpcUa_False, OpcUa_Boolean deleteAllChildren=OpcUa_False)
UaStatus addNodeAndReference (UaReferenceLists *pSourceNode, UaReferenceLists *pNewNode, const UaNodeId &referenceTypeId)
UaStatus addNodeAndReference (const UaNodeId &sourceNode, UaReferenceLists *pNewNode, const UaNodeId &referenceTypeId)
UaStatus addUaReference (UaReferenceLists *pSourceNode, UaReferenceLists *pTargetNode, const UaNodeId &referenceTypeId)
UaStatus addUaReference (const UaNodeId &sourceId, const UaNodeId &targetId, const UaNodeId &referenceTypeId)
UaStatus deleteUaReference (UaReferenceLists *pSourceNode, UaReferenceLists *pTargetNode, const UaNodeId &referenceTypeId)
UaStatus deleteUaReference (const UaNodeId &sourceId, const UaNodeId &targetId, const UaNodeId &referenceTypeId)
OpcUa_UInt16 getNameSpaceIndex () const
virtual UaStatus startUp (ServerManager *)
virtual UaStatus shutDown ()
virtual UaStatus browse (const ServiceContext &, BrowseContext &, UaReferenceDescriptions &)
virtual UaStatus translateBrowsePathToNodeId (const ServiceContext &, const UaNodeId &, UaRelativePath &, UaBrowsePathTargets &)
virtual VariableHandlegetVariableHandle (Session *, VariableHandle::ServiceType, OpcUa_NodeId *, OpcUa_Int32) const
virtual MethodHandlegetMethodHandle (Session *, OpcUa_NodeId *, OpcUa_NodeId *, UaStatus &) const
virtual
NodeManagerCrossReferences
getNodeManagerCrossReferences ()
virtual NodeManagerConfiggetNodeManagerConfig ()
virtual NodeManagerUaNodegetNodeManagerUaNode ()
virtual UaStatus connectStartingNode (const UaNodeId &, NodeManager *, OpcUa_Boolean, OpcUa_Boolean)
virtual UaStatus disconnectStartingNode (const UaNodeId &, NodeManager *)

Protected Member Functions

UaStatusCode clearAllNodes ()
UaNodefindNode (const UaNodeId &id) const
UaNodefindNode (const OpcUa_NodeId *pId) const
UaString getNameSpaceUri ()
OpcUa_Boolean isStarted ()

Protected Attributes

ServerManagerm_pServerManager
 Central server manager object.
NodeManagerCrossReferencesm_pNodeManagerCrossReferences0
 NodeManagerCrossReferences interface of node manager root (name space 0).
NodeManagerListm_pNodeManagerList
 NodeManagerList interface of node manager root (name space 0).
UaString m_defaultLocaleId
 Default LocaleId for the node manager.
OpcUa_Boolean m_isStarted
 Flag indicating if the node manager was started.
UaMutex m_mutexNodes
 This mutex is used to synconize access to the nodes and references in this node manager.
OpcUa_UInt16 m_nNamespaceIndex
 Name space index of this node manager.
UaString m_sNamespaceUri
 Name space URI of this node manager.
HashTablem_pTable
 Hash table for the nodes managed by this node manager.
UaMutex m_mutexAliasTable
 Mutex used to protect access to the hash table.
UaObjectPointerArray< UaNodeIdm_crossNodeManagerAliasNodes
 List of cross node manager alias nodes.
BrowseUaNodeCallbackm_pBrowseUaNodeCallback
 Callback interface to influence browse results.

Detailed Description

Implementation of the interface NodeManager operating on a generic address space node model.

This class implements most of the functionality necessary for a client to navigate through the nodes of the name space managed by this node manager. A derived class containing the product specific implementation must implement the functions afterStartUp to create the nodes of the address space and beforeShutDown to clean up resources in the node manager. It is possible to add and remove nodes and references by using the interface NodeManagerConfig implemented by this node manager class.


Constructor & Destructor Documentation

NodeManagerUaNode::NodeManagerUaNode ( const UaString sNamespaceUri,
OpcUa_Int32  nHashTableSize 
)

Constructs a NodeManagerUaNode object.

Parameters:
[in]sNamespaceUriName space URI for the name space managed by this node manager instance
[in]nHashTableSizeSize of the hash table. The size can be smaller than the total number of nodes managed by the node manager but it is better for the performance to avoid collisions with a large size. Prefered sizes are 1.009, 10.007, 100.003, 1.000.003, 10.000.019
NodeManagerUaNode::~NodeManagerUaNode (  ) [virtual]

Destroys the NodeManagerUaNode object and all nodes managed by the node manager


Member Function Documentation

UaStatus NodeManagerUaNode::addNodeAndReference ( UaReferenceLists pSourceNode,
UaReferenceLists pNewNode,
const UaNodeId referenceTypeId 
) [virtual]

Adds the new node to the node management and creates reference

Adds the passed new node to the internal node management of the NodeManager and creates a reference from the passed source node to the new node.

Returns:
Result code for the requested action
Parameters:
[in]pSourceNodePointer to UaReferenceLists interface of the source node.
[in]pNewNodePointer to UaReferenceLists interface of the new node.
[in]referenceTypeIdType of the reference to create from the source node to the new node.

Implements NodeManagerConfig.

UaStatus NodeManagerUaNode::addNodeAndReference ( const UaNodeId sourceNode,
UaReferenceLists pNewNode,
const UaNodeId referenceTypeId 
) [virtual]

Adds the new node to the node management and creates reference

Adds the passed new node to the internal node management of the NodeManager and creates a reference from the passed source node to the new node.

Returns:
Result code for the requested action
Parameters:
[in]sourceNodeNodeId of the source node.
[in]pNewNodePointer to UaReferenceLists interface of the new node.
[in]referenceTypeIdType of the reference to create from the source node to the new node.

Implements NodeManagerConfig.

UaStatus NodeManagerUaNode::addUaNode ( UaNode pNewNode ) [virtual]

Add a new UaNode to the node management.

Adds the passed new node to the internal node management of the NodeManager.

Returns:
Result code for the requested action
Parameters:
[in]pNewNodePointer to UaNode interface of the new node to add

Implements NodeManagerConfig.

UaStatus NodeManagerUaNode::addUaReference ( UaReferenceLists pSourceNode,
UaReferenceLists pTargetNode,
const UaNodeId referenceTypeId 
) [virtual]

Adds a reference from source node to target node

Creates a reference from the passed source node to the passed target node.

Returns:
Result code for the requested action
Parameters:
[in]pSourceNodePointer to UaReferenceLists interface of the source node.
[in]pTargetNodePointer to UaReferenceLists interface of the target node.
[in]referenceTypeIdType of the reference to create from the source node to the target node.

Implements NodeManagerConfig.

UaStatus NodeManagerUaNode::addUaReference ( const UaNodeId sourceId,
const UaNodeId targetId,
const UaNodeId referenceTypeId 
) [virtual]

Adds a reference from source node to target node

This functions is provided for convenience and behaves like the functions above. This function finds the node objects for the specified source and target nodeIds and creates a new reference if the nodes exist.

Returns:
Result code for the requested action
Parameters:
[in]sourceIdNodeId of the source node.
[in]targetIdNodeId of the target node.
[in]referenceTypeIdType of the reference to create from the source node to the target node.

Implements NodeManagerConfig.

virtual UaStatus NodeManagerUaNode::afterStartUp (  ) [pure virtual]

This method needs to be implemented by the derived class and is called to finish the start up of the NodeManager. This method is typically used to initialize the node manager and to create the nodes available at start up.

Returns:
Result code

Implemented in NodeManagerNS1, NodeManagerRoot, OpcUaDi::NodeManagerDevices, and OpcUaPlc::NodeManagerPLCopen.

virtual UaStatus NodeManagerUaNode::beforeShutDown (  ) [pure virtual]

This method needs to be implemented by the derived class and is called to start the shut down of the NodeManager. This method is typically used to clean up resources in the node manager. The nodes created in the node manager are automatically deleted by the node manager.

Returns:
Result code

Implemented in NodeManagerNS1, NodeManagerRoot, OpcUaDi::NodeManagerDevices, and OpcUaPlc::NodeManagerPLCopen.

UaStatus NodeManagerUaNode::browse ( 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.

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

Implements NodeManager.

Reimplemented in NodeManagerRoot.

UaStatusCode NodeManagerUaNode::clearAllNodes (  ) [protected]

Clear all nodes in the node manager and all references to other node managers.

Returns:
Error code
UaStatus NodeManagerUaNode::connectStartingNode ( const UaNodeId startingNode,
NodeManager pNodeManager,
OpcUa_Boolean  forwardReferences,
OpcUa_Boolean  inverseReferences 
) [virtual]

Connect a starting node to the passed NodeManager This method is used to tell the NodeManager A (implements this method) that another NodeManager B has a Nodes with references to a Node in A but is not able to specify the list. All View services called with the specified Node in A must be called also on NodeManager B to allow B to return affected Nodes.

Parameters:
startingNodeNodeId of the node that needs to be connected to the other NodeManager.
pNodeManagerPointer to NodeManager that manages references from the starting node to nodes in the that NodeManager.
forwardReferencesFlag that indicates that there are forward references.
inverseReferencesFlag that indicates that there are inverse references.
Returns:
Error code

Implements NodeManagerCrossReferences.

UaStatus NodeManagerUaNode::deleteUaNode ( UaNode pNode,
OpcUa_Boolean  deleteTargetReferences,
OpcUa_Boolean  deleteSourceReferences = OpcUa_False,
OpcUa_Boolean  deleteAllChildren = OpcUa_False 
) [virtual]

Remove a UaNode from the node management.

Removes the passed node from the internal node management of the NodeManager.

Returns:
Result code for the requested action
Parameters:
[in]pNodePointer to UaNode interface of the node to remove.
[in]deleteTargetReferencesFlag indicating if the inverse references in the target nodes must be deleted
[in]deleteSourceReferencesFlag indicating if the inverse references in the target nodes must be deleted
[in]deleteAllChildrenIndicates if all child nodes of the node to delete and all references of the nodes must be deleted. In this case the fuction follows all forward references that are a subtype of HasChildren like HasComponent or HasProperty and deletes the target nodes and all of their references. If this flag is set and one of the child nodes to delete is shared, the shared node and its children is not deleted.

Implements NodeManagerConfig.

UaStatus NodeManagerUaNode::deleteUaReference ( const UaNodeId sourceId,
const UaNodeId targetId,
const UaNodeId referenceTypeId 
) [virtual]

Delete the reference from source node to target node

This functions is provided for convenience and behaves like the functions above. This function finds the node objects for the specified source and target nodeIds and creates a deletes the reference if the nodes exist.

Returns:
Result code for the requested action
Parameters:
[in]sourceIdNodeId of the source node.
[in]targetIdNodeId of the target node.
[in]referenceTypeIdType of the reference to delete from the source node to the target node.

Implements NodeManagerConfig.

UaStatus NodeManagerUaNode::deleteUaReference ( UaReferenceLists pSourceNode,
UaReferenceLists pTargetNode,
const UaNodeId referenceTypeId 
) [virtual]

Delete the reference from source node to target node

Deletes the reference of the passed type from the passed source node to the passed target node.

Returns:
Result code for the requested action
Parameters:
[in]pSourceNodePointer to UaReferenceLists interface of the source node.
[in]pTargetNodePointer to UaReferenceLists interface of the target node.
[in]referenceTypeIdType of the reference to delete from the source node to the target node.

Implements NodeManagerConfig.

UaStatus NodeManagerUaNode::disconnectStartingNode ( const UaNodeId startingNode,
NodeManager pNodeManager 
) [virtual]

Disconnect a starting node from the passed NodeManager

Parameters:
startingNodeNodeId of the node that needs to be disconnected from the other NodeManager.
pNodeManagerPointer of the NodeManager to disconnect.
Returns:
Error code

Implements NodeManagerCrossReferences.

UaNode * NodeManagerUaNode::findNode ( const UaNodeId id ) const [protected]

Find a UaNode by UaNodeId.

Parameters:
idNodeId to convert.
Returns:
the current searched Node.
UaNode * NodeManagerUaNode::findNode ( const OpcUa_NodeId *  pId ) const [protected]

Find a UaNode by OpcUa_NodeId.

Parameters:
pIdNodeId to convert.
Returns:
the curent searched Node.
virtual IOManager* NodeManagerUaNode::getIOManager ( UaNode pUaNode,
OpcUa_Int32  attributeId 
) const [pure virtual]

Get the responsible IOManager for the node and attribute combination.

Parameters:
pUaNodethe actual Node where to get all information from.
attributeIdAttributeId of the requested node
Returns:
a Variable to the IOManager.

Implemented in NodeManagerBase, NodeManagerRoot, OpcUaDi::NodeManagerDevices, and OpcUaPlc::NodeManagerPLCopen.

MethodHandle * NodeManagerUaNode::getMethodHandle ( Session pSession,
OpcUa_NodeId *  pObjectNodeId,
OpcUa_NodeId *  pMethodNodeId,
UaStatus result 
) const [virtual]

Get the method handle for the passed node Id. This method is used to get the MethodHandle for a Object node / Method combination used to access the related MethodManager in the service Call.

Parameters:
pSessionInterface to the Session context for the method call
pObjectNodeIdthe NodeId of the actual Object.
pMethodNodeIdthe NodeId of the actual Method.
resultthe result of the current Operation.
Returns:
Error code

Reimplemented from NodeManager.

Reimplemented in NodeManagerRoot.

OpcUa_UInt16 NodeManagerUaNode::getNameSpaceIndex (  ) const [inline, virtual]

Get the namespace index of the node manager.

Implements NodeManagerConfig.

UaString NodeManagerUaNode::getNameSpaceUri (  ) [inline, protected]

Get the name space URI of this node manager.

Returns:
the requested Namespace Uri.
UaNode * NodeManagerUaNode::getNode ( const UaNodeId nodeId ) [virtual]

Get a UaNode pointer for a requested nodeId. If a UaNode object is found for the nodeId the reference count of the node gets incremented and a pointer to the node ist returned. The caller must release the reference when the node is not longer needed.

Parameters:
nodeIdNodeId of the node to return.
Returns:
The requested node. Null if node was not found. The reference count for the found node is incremented.

Reimplemented in NodeManagerRoot.

NodeManagerConfig * NodeManagerUaNode::getNodeManagerConfig (  ) [virtual]

Get the interface NodeManagerConfig if available.

Returns:
the NodeManagerConfig Variable.

Reimplemented from NodeManager.

Reimplemented in NodeManagerRoot.

NodeManagerCrossReferences * NodeManagerUaNode::getNodeManagerCrossReferences (  ) [virtual]

Get the interface NodeManagerCrossReferences if available.

Returns:
the NodeManagerCrossReferences interface pointer.

Reimplemented from NodeManager.

Reimplemented in NodeManagerRoot.

NodeManagerUaNode * NodeManagerUaNode::getNodeManagerUaNode (  ) [virtual]

Get the interface NodeManagerUaNode if available.

Returns:
the NodeManagerUaNode interface pointer.

Reimplemented from NodeManager.

VariableHandle * NodeManagerUaNode::getVariableHandle ( Session pSession,
VariableHandle::ServiceType  serviceType,
OpcUa_NodeId *  pNodeId,
OpcUa_Int32  AttributeId 
) const [virtual]

Get the variable handle for the passed node Id. This method is used to get the VariableHandle for a node used to access the related IOManager in the services Read, Write and CreateMonitoredItems. The provided VariableHandle is reference counted. The reference count is 1 after initial creation of the object. The SDK will release its reference after the transaction is finished. If the VariableHandle is stored in an application specific object, the reference counter must be incremented to keep the one reference. If this stored pointer is used to return the VariableHandle in following getVariableHandle calls, the reference counter must be incrementd before returning the pointer.

Parameters:
pSessionInterface to the Session context for the method call
serviceTypeService type enumerator with the following possible settings READ - Read service WRITE - Write service MONITORING - CreateMonitoredItems service
pNodeIdNodeId of the requested node
AttributeIdAttributeId of the requested node
Returns:
The variable handle for the passed node Id and attribute Id combination.

Implements NodeManager.

Reimplemented in NodeManagerRoot.

OpcUa_Boolean NodeManagerUaNode::isStarted (  ) [inline, protected]

Check if the NodeManager is started or not.

Returns:
a bool value if started or not.
void NodeManagerUaNode::registerBrowseUaNodeCallback ( BrowseUaNodeCallback pBrowseUaNodeCallback )

Registeres a callback interface used to influence browse results.

UaStatus NodeManagerUaNode::shutDown (  ) [virtual]

Shut down NodeManager. Method is called during shut down of OPC Server and can be used to clean up the configuration of the NodeManager.

Returns:
Error code

Implements NodeManager.

UaStatus NodeManagerUaNode::startUp ( ServerManager pServerManager ) [virtual]

Start up NodeManager.

Parameters:
pServerManagerInterface to the central ServerManager object. This interface pointer should be stored in the NodeManager instance to have access to core module objects like the root NodeManager or the ServerConfig
Returns:
Error code

Implements NodeManager.

Reimplemented in NodeManagerBase, NodeManagerNS1, and NodeManagerRoot.

UaStatus NodeManagerUaNode::translateBrowsePathToNodeId ( const ServiceContext serviceContext,
const UaNodeId startingNode,
UaRelativePath relativePath,
UaBrowsePathTargets &  browsePathTargets 
) [virtual]

Translates a relative browse path to a node id. This method is used to request the Server to translate a browse paths to a NodeId for the target node. There could be a list of target nodes but the normal case is a single result for a starting node and a path. The browse path is constructed of a starting Node and a RelativePath. The specified starting Node identifies the Node from which the RelativePath is based. The RelativePath contains a sequence of BrowseNames. The relative path parameter contains a list of relative path elements and the current position of the translate process since the translate can affect more than one node manager and the implementation of this method is only responsible for processing relative path elements and starting nodes managed by the current node manager instance.

Parameters:
serviceContextGeneral context for the service calls containing information like the session object, return diagnostic mask and timeout hint.
startingNodeStarting node from where the relative path is defined.
relativePathRelative path from the starting node to the searched node including the current position of the translate process.
See also:
UaRelativePath provides more details.
Parameters:
browsePathTargetsAll result target nodes for the Browsepath.
Returns:
Error code

Implements NodeManager.

Reimplemented in NodeManagerRoot.


The documentation for this class was generated from the following files:
  • /home/buildbot/work/uasdkcpp/src/uaserver/uaservercpp/coremodule/nodemanageruanode.h
  • /home/buildbot/work/uasdkcpp/src/uaserver/uaservercpp/coremodule/nodemanageruanode.cpp