C++ Based OPC UA Client/Server/PubSub SDK
1.7.6.537
|
Implementation of the interface NodeManager operating on a generic address space node model. More...
#include <nodemanageruanode.h>
Inherits NodeManager, NodeManagerConfig, NodeManagerCrossReferences, UaDataTypeDictionary, and OpcUa::AddressSpaceFileCallback.
Inherited by NodeManagerBase.
Public Member Functions | |
NodeManagerUaNode (const UaString &sNamespaceUri, OpcUa_Int32 nHashTableSize) | |
Constructs a NodeManagerUaNode object. More... | |
virtual | ~NodeManagerUaNode () |
Destroys the NodeManagerUaNode object and all nodes managed by the NodeManager. More... | |
virtual UaStatus | afterStartUp ()=0 |
This method needs to be implemented by the derived class and is called to finish the startup of the NodeManager. More... | |
virtual UaStatus | beforeShutDown ()=0 |
This method needs to be implemented by the derived class and is called to start the shutdown of the NodeManager. More... | |
virtual IOManager * | getIOManager (UaNode *pUaNode, OpcUa_Int32 attributeId) const =0 |
Get the responsible IOManager for the node and attribute combination. More... | |
virtual UaNode * | getNode (const UaNodeId &nodeId) |
Get a UaNode pointer for a requested nodeId. More... | |
void | registerBrowseUaNodeCallback (BrowseUaNodeCallback *pBrowseUaNodeCallback) |
Registers a callback interface used to influence browse results. | |
void | setDefaultMethodManager (MethodManager *pMethodManager) |
Sets a default MethodManager; used if Object does not implement MethodManager. More... | |
void | setFallbackMethodManager (MethodManager *pMethodManager) |
Set a fallback MethodManager; used if Object and Method are not available as UaNode. More... | |
virtual void | setDefaultPermissions (NodeAccessInfo *pDefaultPermissions) |
Set the default permissions defined for this namespace. More... | |
UaStatus | createNamespaceMetaData (bool addNamespaceFile, const UaString &sNamespaceFile, bool addPermissionProperties) |
Creates the namespace metadata object. More... | |
OpcUa::NamespaceMetadataType * | pNamespaceMetaData () const |
Get the namespace metadata object if it was created. More... | |
UaStatus | addUaNode (UaNode *pNewNode) |
Adds a new UaNode to the node management. More... | |
UaStatus | deleteUaNode (UaNode *pNode, OpcUa_Boolean deleteTargetReferences, OpcUa_Boolean deleteSourceReferences=OpcUa_False, OpcUa_Boolean deleteAllChildren=OpcUa_False) |
Removes a UaNode from the node management. More... | |
UaStatus | addNodeAndReference (UaReferenceLists *pSourceNode, UaReferenceLists *pNewNode, const UaNodeId &referenceTypeId) |
Adds the new node to the node management and creates a reference. More... | |
UaStatus | addNodeAndReference (const UaNodeId &sourceNode, UaReferenceLists *pNewNode, const UaNodeId &referenceTypeId) |
Adds the new node to the node management and creates a reference. More... | |
UaStatus | addUaReference (UaReferenceLists *pSourceNode, UaReferenceLists *pTargetNode, const UaNodeId &referenceTypeId) |
Adds a reference from source node to target node. More... | |
UaStatus | addUaReference (const UaNodeId &sourceId, const UaNodeId &targetId, const UaNodeId &referenceTypeId) |
Adds a reference from the source node to the target node. More... | |
UaStatus | deleteUaReference (UaReferenceLists *pSourceNode, UaReferenceLists *pTargetNode, const UaNodeId &referenceTypeId) |
Deletes the reference from the source node to the target node. More... | |
UaStatus | deleteUaReference (const UaNodeId &sourceId, const UaNodeId &targetId, const UaNodeId &referenceTypeId) |
Deletes the reference from the source node to the target node. More... | |
OpcUa_UInt16 | getNameSpaceIndex () const |
Get the namespace index of the NodeManager. More... | |
void | lockNodes () |
Lock access to nodes managed by the NodeManagerConfig. | |
void | unlockNodes () |
Unlock access to nodes managed by the NodeManagerConfig. | |
virtual UaStatus | startUp (ServerManager *) |
Start up NodeManager. More... | |
virtual UaStatus | shutDown () |
Shut down module. More... | |
virtual UaStatus | browse (const ServiceContext &, BrowseContext &, UaReferenceDescriptions &) |
Discover the references of a specified node of a view. More... | |
virtual UaStatus | translateBrowsePathToNodeId (const ServiceContext &, const UaNodeId &, UaRelativePath &, UaBrowsePathTargets &) |
Translates a relative BrowsePath to a NodeId. More... | |
virtual VariableHandle * | getVariableHandle (Session *, VariableHandle::ServiceType, OpcUa_NodeId *, OpcUa_Int32) const |
Get the variable handle for the passed node Id. More... | |
virtual MethodHandle * | getMethodHandle (Session *, OpcUa_NodeId *, OpcUa_NodeId *, UaStatus &) const |
Get the method handle for the passed node Id. More... | |
virtual NodeManagerCrossReferences * | getNodeManagerCrossReferences () |
Get the interface NodeManagerCrossReferences if available. More... | |
virtual NodeManagerConfig * | getNodeManagerConfig () |
Gets the interface NodeManagerConfig if available. More... | |
virtual NodeManagerUaNode * | getNodeManagerUaNode () |
Gets the interface NodeManagerUaNode if available. More... | |
virtual NodeAccessInfo * | getDefaultPermissions (OpcUa_UInt16 namespaceIndex) const |
Get the default permissions defined for this namespace. More... | |
virtual UaStatus | createRoleOperations (const UaString &roleName, RoleTypeOperations **ppRoleTypeOperations) |
Create a new Role with the specified name and return a pointer to the new RoleTypeOperation instance. More... | |
virtual UaStatus | removeRoleOperations (RoleTypeOperations *pRoleTypeOperations) |
Remove a Role that was created by this NodeManager. More... | |
virtual UaStatus | connectStartingNode (const UaNodeId &, NodeManager *, OpcUa_Boolean, OpcUa_Boolean) |
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. More... | |
virtual UaStatus | disconnectStartingNode (const UaNodeId &, NodeManager *) |
Disconnect a starting node from the passed NodeManager. More... | |
virtual UaStatus | addCrossReference (const UaNodeId &, const UaNodeId &, OpcUa_Boolean, const UaNodeId &, NodeManager *) |
Creates a reference between nodes managed by different NodeManagers. More... | |
virtual UaStatus | deleteCrossReference (const UaNodeId &, const UaNodeId &, OpcUa_Boolean, const UaNodeId &, NodeManager *) |
Deletes a reference between nodes managed by different NodeManagers. More... | |
UaStatus | addTypeDictionary (const UaNodeId &nodeId, const UaString &sName, const UaString &sNamespaceUri=UaString()) |
Adds a DataTypeDictionary to the Binary DataTypeSystem. More... | |
UaStatus | setTypeDictionary (OpcUa::DataTypeDictionaryType *pTypeDictionary) |
Adds a DataTypeDictionary to the Binary DataTypeSystem without adding nodes. More... | |
UaStatus | addTypeDictionaryXml (const UaNodeId &nodeId, const UaString &sName, const UaString &sNamespaceUri=UaString()) |
Adds a DataTypeDictionary to the XML DataTypeSystem. More... | |
UaStatus | setXmlTypeDictionary (OpcUa::DataTypeDictionaryType *pTypeDictionary) |
Adds a DataTypeDictionary to the XML DataTypeSystem without adding nodes. More... | |
UaStatus | addStructuredType (const UaStructureDefinition &structure) |
Adds a new DataType node and all needed DataTypeEncoding and DataTypeDescription nodes. More... | |
UaStatus | addStructuredTypes (std::list< UaStructureDefinition > &structures) |
Adds a list of new DataType nodes and all needed DataTypeEncoding and DataTypeDescription nodes. More... | |
UaStatus | addStructuredTypeDefinition (const UaStructureDefinition &structure) |
Adds a structured DataType definition without adding nodes. More... | |
UaStatus | addEnumeratedType (const UaEnumDefinition &enumeration, const UaNodeId &enumerationPropertyId=UaNodeId()) |
Adds a new DataType node and the needed property. More... | |
UaStatus | addEnumeratedTypes (std::list< UaEnumDefinition > &enumerations) |
Adds a list of new DataType nodes and the needed property. More... | |
UaStatus | addOptionSetType (const UaOptionSetDefinition &optionSet, const UaNodeId &optionSetPropertyId=UaNodeId()) |
Adds a new DataType node and the needed property. More... | |
UaStatus | addOptionSetTypes (std::list< UaOptionSetDefinition > &optionSets) |
Adds a list of new DataType nodes and the needed property. More... | |
void | setDataTypeVersion (const UaString &sDataTypeVersion) |
Sets the version of the dictionaries. More... | |
UaString | dataTypeVersion () const |
Returns the version of the dictionaries. More... | |
void | findDefinitionsForStructureFields () |
Searches for UaEnumDefinitions and UaStructureDefinitions in UaStructureFields. | |
virtual UaDataTypeDictionary::DefinitionType | definitionType (const UaNodeId &dataTypeId) |
Returns the UaDataTypeDictionary::DefinitionType for a data type. More... | |
virtual UaEnumDefinition | enumDefinition (const UaNodeId &dataTypeId) |
Returns the UaEnumDefinition for a specified DataType. More... | |
virtual UaStructureDefinition | structureDefinition (const UaNodeId &dataTypeId) |
Returns the UaStructureDefinition for a specified DataType. More... | |
virtual UaOptionSetDefinition | optionSetDefinition (const UaNodeId &dataTypeId) |
Returns the UaOptionSetDefinition for the specified data type. More... | |
virtual UaStatus | exportNamespace (const ServiceContext &serviceContext, OpcUa::AddressSpaceFileType *pAddressSpaceFile) |
Provides a way to export the namespace from the Server address space to the XML file represented by the AddressSpaceFileType. More... | |
virtual XmlUaNodeFactoryNamespace * | getUaNodeFactory (OpcUa_UInt16 namespaceIndex) const |
Returns the UaNode factory for the namespace if supported by the NodeManager. More... | |
OpcUa_Boolean | isStarted () |
Checks whether the NodeManager is started or not. More... | |
Public Member Functions inherited from NodeManager | |
NodeManager () | |
construction | |
virtual | ~NodeManager () |
destruction | |
virtual UaStatus | sessionOpened (Session *) |
Notifies the node manager that a new session was opened. More... | |
virtual UaStatus | sessionActivated (Session *) |
Notifies the node manager that a session was activated. More... | |
virtual UaStatus | sessionClosed (Session *) |
Notifies the node manager that a session was closed. More... | |
virtual HistoryVariableHandle * | getHistoryVariableHandle (Session *pSession, HistoryVariableHandle::ServiceType serviceType, OpcUa_NodeId *pNodeId, UaStatus &result) const |
Get the history variable handle for the passed node Id. More... | |
virtual UaStatus | getEventManagers (Session *pSession, OpcUa_NodeId *pNodeId, OpcUa_EventFilter *eventFilter, EventManagerArray &eventManagers) const |
Get a list of EventManager interfaces for an event notifier. More... | |
virtual UaStatus | addNode (const ServiceContext &serviceContext, const UaNodeId &parentNodeId, const UaNodeId &referenceTypeId, const UaNodeId &requestedNewNodeId, const UaQualifiedName &browseName, OpcUa_NodeClass nodeClass, const UaExtensionObject &nodeAttributes, const UaNodeId &typeDefinition, UaNodeId &addedNodeId) |
Add node to the NodeManager. More... | |
virtual UaStatus | addReference (const ServiceContext &serviceContext, const UaNodeId &sourceNodeId, const UaNodeId &referenceTypeId, OpcUa_Boolean isForward, const UaNodeId &targetNodeId, OpcUa_NodeClass targetNodeClass) |
Add reference to the NodeManager. More... | |
virtual UaStatus | deleteNode (const ServiceContext &serviceContext, const UaNodeId &nodeId, OpcUa_Boolean deleteTargetReference) |
Delete node from the NodeManager. More... | |
virtual UaStatus | deleteReference (const ServiceContext &serviceContext, const UaNodeId &sourceNodeId, const UaNodeId &referenceTypeId, OpcUa_Boolean isForward, const UaNodeId &targetNodeId, OpcUa_Boolean deleteBidirectional) |
Delete reference from the NodeManager. More... | |
Public Member Functions inherited from NodeManagerConfig | |
NodeManagerConfig () | |
construction | |
virtual | ~NodeManagerConfig () |
destruction | |
virtual EventManagerUaNode * | getEventManagerUaNode () |
Get the EventManagerUaNode interface if implemented by the class implementing the NodeManagerConfig interface. More... | |
virtual NodeManagerNodeSetXml * | getNodeManagerNodeSetXml () |
Get the NodeManagerNodeSetXml interface if implemented by the class implementing the NodeManagerConfig interface. More... | |
Public Member Functions inherited from NodeManagerCrossReferences | |
NodeManagerCrossReferences () | |
construction | |
virtual | ~NodeManagerCrossReferences () |
destruction | |
Public Member Functions inherited from UaDataTypeDictionary | |
DefinitionType | definitionType (const UaVariant &vValue) |
Returns the UaDataTypeDictionary::DefinitionType of a variant. More... | |
DefinitionType | definitionType (const UaExtensionObject &vValue) |
Returns the UaDataTypeDictionary::DefinitionType of an ExtensionObject. More... | |
UaStructureDefinition | structureDefinition (const UaVariant &vValue) |
Returns the UaStructureDefinition of a variant. More... | |
UaStructureDefinition | structureDefinition (const UaExtensionObject &vValue) |
Returns the UaStructureDefinition of an ExtensionObject. More... | |
virtual UaSimpleDefinition | simpleDefinition (const UaNodeId &dataTypeId) |
Returns the UaSimpleDefinition for a simple DataType. More... | |
Protected Member Functions | |
UaStatusCode | clearAllNodes () |
Clears all nodes in the NodeManager and all references to other NodeManagers. More... | |
UaNode * | findNode (const UaNodeId &nodeId) const |
Find a UaNode by UaNodeId. More... | |
UaNode * | findNode (const OpcUa_NodeId *pNodeId) const |
Find a UaNode by OpcUa_NodeId. More... | |
bool | referenceExists (UaReferenceLists *pSourceNode, UaReferenceLists *pTargetNode, const UaNodeId &referenceTypeId) |
Check if the exact same reference exists already. More... | |
UaString | getNameSpaceUri () |
Gets the namespace URI of this NodeManager. More... | |
Protected Attributes | |
ServerManager * | m_pServerManager |
Central server manager object. | |
NodeManagerCrossReferences * | m_pNodeManagerCrossReferences0 |
NodeManagerCrossReferences interface of NodeManager root (namespace 0). | |
NodeManagerList * | m_pNodeManagerList |
NodeManagerList interface of NodeManager root (namespace 0). | |
UaString | m_defaultLocaleId |
Default LocaleId for the NodeManager. | |
OpcUa_Boolean | m_isStarted |
Flag indicating whether the NodeManager was started. | |
UaMutex | m_mutexNodes |
This mutex is used to synchronize access to the nodes and references in this NodeManager. | |
UaMutexRefCounted * | m_pMutexNodeAccessInfo |
This mutex is used to synchronize access to the member m_pDefaultAccessPermissions and all instances of NodeAccessInfo created in this class. | |
OpcUa_UInt16 | m_nNamespaceIndex |
Namespace index of this NodeManager. | |
UaString | m_sNamespaceUri |
Namespace URI of this NodeManager. | |
HashTable * | m_pTable |
Hash table for the nodes managed by this NodeManager. | |
UaMutex | m_mutexAliasTable |
Mutex used to protect access to the cross NodeManager alias nodes. | |
std::set< UaNodeId > | m_setCrossNodeManagerAliasNodes |
List of AliasNodeIds - used to call disconnectStartingNode. | |
BrowseUaNodeCallback * | m_pBrowseUaNodeCallback |
Callback interface to influence browse results. | |
MethodManager * | m_pDefaultMethodManager |
Method manager called if object and method were found but object does not implement MethodManager. | |
MethodManager * | m_pFallbackMethodManager |
Method manager called with NodeIds if object and method were not found, like for conditions without nodes in address space. | |
TypeDictionaries * | m_pTypeDictionaries |
Used for managing custom Structured DataTypes and Enumerated DataTypes that are added during runtime. More... | |
Additional Inherited Members | |
Public Types inherited from UaDataTypeDictionary | |
enum | DefinitionType |
Enumeration that indicates the DataType definition type. | |
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 namespace managed by this NodeManager. 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 NodeManager. It is possible to add and remove nodes and references by using the interface NodeManagerConfig implemented by this NodeManager class.
NodeManagerUaNode::NodeManagerUaNode | ( | const UaString & | sNamespaceUri, |
OpcUa_Int32 | nHashTableSize | ||
) |
Constructs a NodeManagerUaNode object.
[in] | sNamespaceUri | Namespace URI for the namespace managed by this NodeManager instance. |
[in] | nHashTableSize | Size of the hash table. The size can be smaller than the total number of nodes managed by the NodeManager but it is better for the performance to avoid collisions with a large size. Preferred sizes are 1.009, 10.007, 100.003, 1.000.003, 10.000.019 |
|
virtual |
Destroys the NodeManagerUaNode object and all nodes managed by the NodeManager.
|
virtual |
Creates a reference between nodes managed by different NodeManagers.
Reimplemented from NodeManagerCrossReferences.
UaStatus NodeManagerUaNode::addEnumeratedType | ( | const UaEnumDefinition & | enumeration, |
const UaNodeId & | enumerationPropertyId = UaNodeId() |
||
) |
Adds a new DataType node and the needed property.
Updates the DataTypeDictionary if the compiler flag SUPPORT_XML_PARSER is set to 1. The method addTypeDictionary must be called before calling this method.
enumeration | The NamespaceIndex of the DataType must be the same as the NamespaceIndex of the NodeConfig. |
enumerationPropertyId | If null, a string NodeId is created for the property. |
UaStatus NodeManagerUaNode::addEnumeratedTypes | ( | std::list< UaEnumDefinition > & | enumerations | ) |
Adds a list of new DataType nodes and the needed property.
Updates the DataTypeDictionary if the compiler flag SUPPORT_XML_PARSER is set to 1. The method addTypeDictionary must be called before calling this method.
enumerations | The NamespaceIndex of the DataTypes must be the same as the NamespaceIndex of the NodeConfig. |
|
virtual |
Adds the new node to the node management and creates a 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.
[in] | pSourceNode | Pointer to UaReferenceLists interface of the source node. |
[in] | pNewNode | Pointer to UaReferenceLists interface of the new node. |
[in] | referenceTypeId | Type of the reference to create from the source node to the new node. |
Implements NodeManagerConfig.
|
virtual |
Adds the new node to the node management and creates a 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.
[in] | sourceNode | NodeId of the source node. |
[in] | pNewNode | Pointer to UaReferenceLists interface of the new node. |
[in] | referenceTypeId | Type of the reference to create from the source node to the new node. |
Implements NodeManagerConfig.
UaStatus NodeManagerUaNode::addOptionSetType | ( | const UaOptionSetDefinition & | optionSet, |
const UaNodeId & | optionSetPropertyId = UaNodeId() |
||
) |
Adds a new DataType node and the needed property.
Updates the DataTypeDictionary if the compiler flag SUPPORT_XML_PARSER is set to 1 and the optionSet is a subtype of OptionSet. The method addTypeDictionary must be called before calling this method.
optionSet | The NamespaceIndex of the DataType must be the same as the NamespaceIndex of the NodeConfig. |
optionSetPropertyId | If null, a string NodeId is created for the property. |
UaStatus NodeManagerUaNode::addOptionSetTypes | ( | std::list< UaOptionSetDefinition > & | optionSets | ) |
Adds a list of new DataType nodes and the needed property.
Updates the DataTypeDictionary if the compiler flag SUPPORT_XML_PARSER is set to 1 and one optionSets is a subtype of OptionSet. The method addTypeDictionary must be called before calling this method.
optionSets | The NamespaceIndex of the DataTypes must be the same as the NamespaceIndex of the NodeConfig. |
UaStatus NodeManagerUaNode::addStructuredType | ( | const UaStructureDefinition & | structure | ) |
Adds a new DataType node and all needed DataTypeEncoding and DataTypeDescription nodes.
Updates the DataTypeDictionary if the compiler flag SUPPORT_XML_PARSER is set to 1. The method addTypeDictionary or setTypeDictionary must be called before calling this method.
structure | The NamespaceIndex of the DataType and the BinaryEncodingId must be the same as the NamespaceIndex of the NodeConfig. |
UaStatus NodeManagerUaNode::addStructuredTypeDefinition | ( | const UaStructureDefinition & | structure | ) |
Adds a structured DataType definition without adding nodes.
Updates the DataTypeDictionary if the compiler flag SUPPORT_XML_PARSER is set to 1. The method addTypeDictionary or setTypeDictionary must be called before calling this method.
structure | The NamespaceIndex of the DataType and the BinaryEncodingId must be the same as the NamespaceIndex of the NodeConfig. |
UaStatus NodeManagerUaNode::addStructuredTypes | ( | std::list< UaStructureDefinition > & | structures | ) |
Adds a list of new DataType nodes and all needed DataTypeEncoding and DataTypeDescription nodes.
Updates the DataTypeDictionary if the compiler flag SUPPORT_XML_PARSER is set to 1. The method addTypeDictionary or setTypeDictionary must be called before calling this method.
structures | The NamespaceIndex of the DataTypes and the BinaryEncodingId must be the same as the NamespaceIndex of the NodeConfig. |
UaStatus NodeManagerUaNode::addTypeDictionary | ( | const UaNodeId & | nodeId, |
const UaString & | sName, | ||
const UaString & | sNamespaceUri = UaString() |
||
) |
Adds a DataTypeDictionary to the Binary DataTypeSystem.
This method and setTypeDictionary must called at most one time for a NodeManager.
nodeId | The NodeId of the Dictionary node. The NamespaceIndex must match the NamespaceIndex of this NodeManager. |
sName | The name of the Dictionary node. |
sNamespaceUri | The namespace uri for the dictionary. If empty, the namespace uri of the NodeManager is used. |
UaStatus NodeManagerUaNode::addTypeDictionaryXml | ( | const UaNodeId & | nodeId, |
const UaString & | sName, | ||
const UaString & | sNamespaceUri = UaString() |
||
) |
Adds a DataTypeDictionary to the XML DataTypeSystem.
This method and setXmlTypeDictionary must called at most one time for a NodeManager.
nodeId | The NodeId of the Dictionary node. The NamespaceIndex must match the NamespaceIndex of this NodeManager. |
sName | The name of the Dictionary node. It is recommended that the names of the XML dictionary and the binary dictionary are the same. |
sNamespaceUri | The namespace uri for the dictionary. If empty, the namespace uri of the NodeManager is used. |
Adds a new UaNode to the node management.
Adds the passed new node to the internal node management of the NodeManager.
[in] | pNewNode | Pointer to UaNode interface of the new node to add |
Implements NodeManagerConfig.
|
virtual |
Adds a reference from source node to target node.
Creates a reference from the passed source node to the passed target node.
[in] | pSourceNode | Pointer to UaReferenceLists interface of the source node. |
[in] | pTargetNode | Pointer to UaReferenceLists interface of the target node. |
[in] | referenceTypeId | Type of the reference to create from the source node to the target node. |
Implements NodeManagerConfig.
|
virtual |
Adds a reference from the source node to the 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.
[in] | sourceId | NodeId of the source node. |
[in] | targetId | NodeId of the target node. |
[in] | referenceTypeId | Type of the reference to create from the source node to the target node. |
Implements NodeManagerConfig.
|
pure virtual |
This method needs to be implemented by the derived class and is called to finish the startup of the NodeManager.
This method is typically used to initialize the NodeManager and to create the nodes available at startup.
Implemented in NodeManagerRoot, NodeManagerNS1, OpcUaDi::NodeManagerDevicesBase, OpcUaPlc::NodeManagerPLCopenBase, OpcUaDi::NodeManagerDevices, OpcUaPlc::NodeManagerPLCopen, and NodeManagerNodeSetXml.
|
pure virtual |
This method needs to be implemented by the derived class and is called to start the shutdown of the NodeManager.
This method is typically used to clean up resources in the NodeManager. The nodes created in the NodeManager are automatically deleted by the NodeManager.
Implemented in NodeManagerRoot, NodeManagerNS1, OpcUaDi::NodeManagerDevices, OpcUaPlc::NodeManagerPLCopen, and NodeManagerNodeSetXml.
|
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.
serviceContext | General context for the service call containing information like the session object, return diagnostic mask and timeout hint. |
browseContext | Browse context for the first browse or the following browse next calls with continuation point. |
References | Array of ReferenceDescription results for the browsed node. |
Implements NodeManager.
Reimplemented in NodeManagerRoot.
|
protected |
Clears all nodes in the NodeManager and all references to other NodeManagers.
|
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.
startingNode | NodeId of the node that needs to be connected to the other NodeManager. |
pNodeManager | Pointer to NodeManager that manages references from the starting node to nodes in the that NodeManager. |
forwardReferences | Flag that indicates that there are forward references. |
inverseReferences | Flag that indicates that there are inverse references. |
Implements NodeManagerCrossReferences.
UaStatus NodeManagerUaNode::createNamespaceMetaData | ( | bool | addNamespaceFile, |
const UaString & | sNamespaceFile, | ||
bool | addPermissionProperties | ||
) |
Creates the namespace metadata object.
If the optional object NamespaceFile is created, the default permissions for the NamespaceFile require ConfigureAdmin role to access the object. The permission can be changed on the NamespaceFile object after creation. Use pNamespaceMetaData() to access the object.
If the optional permission and access restriction properties are created, the default permissions for the properties require SecurityAdmin role to access the properties. The permission can be changed on the property nodes after creation. Use pNamespaceMetaData() to access the properties.
The following default values are set for the properties
The property values can be changed on the property nodes after creation. Use pNamespaceMetaData() to access the properties e.g. pNamespaceMetaData()->setNamespacePublicationDate()
[in] | addNamespaceFile | Defines if the optional NamespaceFile is created |
[in] | sNamespaceFile | Location and name of the NamespaceFile |
[in] | addPermissionProperties | Defines if the optional properties DefaultRolePermissions and DefaultAccessRestrictions are created |
|
virtual |
Create a new Role with the specified name and return a pointer to the new RoleTypeOperation instance.
roleName | The name for the new Role to add. |
ppRoleTypeOperations | A pointer to the RoleOperation interface created by the Nodemanager. |
Reimplemented from NodeManager.
UaString NodeManagerUaNode::dataTypeVersion | ( | ) | const |
Returns the version of the dictionaries.
The method addTypeDictionary must be called before calling this method.
|
virtual |
Returns the UaDataTypeDictionary::DefinitionType for a data type.
A binary dictionary has to be cretead with addTypeDictionary and a definition for the dataTypeId has to be added with addStructuredType or addEnumeratedType before calling this method. Otherwise, UaDataTypeDictionary::DefinitionType_None is returned.
dataTypeId | The NamespaceIndex of dataTypeId must be the NamespaceIndex of this NodeManager instance. |
Implements UaDataTypeDictionary.
|
virtual |
Deletes a reference between nodes managed by different NodeManagers.
Reimplemented from NodeManagerCrossReferences.
|
virtual |
Removes a UaNode from the node management.
Removes the passed node from the internal node management of the NodeManager.
[in] | pNode | Pointer to UaNode interface of the node to remove. |
[in] | deleteTargetReferences | Flag indicating if the inverse references in the target nodes must be deleted |
[in] | deleteSourceReferences | Flag indicating if the inverse references in the target nodes must be deleted |
[in] | deleteAllChildren | Indicates whether all child nodes of the node to delete and all references of the nodes must be deleted. In this case, the function 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 are not deleted. |
Implements NodeManagerConfig.
|
virtual |
Deletes the reference from the source node to the target node.
Deletes the reference of the passed type from the passed source node to the passed target node.
[in] | pSourceNode | Pointer to UaReferenceLists interface of the source node. |
[in] | pTargetNode | Pointer to UaReferenceLists interface of the target node. |
[in] | referenceTypeId | Type of the reference to delete from the source node to the target node. |
Implements NodeManagerConfig.
|
virtual |
Deletes the reference from the source node to the target node.
This functions is provided for convenience and behaves like the functions above. It finds the node objects for the specified source and target nodeIds and deletes the reference if the nodes exist.
[in] | sourceId | NodeId of the source node. |
[in] | targetId | NodeId of the target node. |
[in] | referenceTypeId | Type of the reference to delete from the source node to the target node. |
Implements NodeManagerConfig.
|
virtual |
Disconnect a starting node from the passed NodeManager.
startingNode | NodeId of the node that needs to be disconnected from the other NodeManager. |
pNodeManager | Pointer of the NodeManager to disconnect. |
Implements NodeManagerCrossReferences.
|
virtual |
Returns the UaEnumDefinition for a specified DataType.
A UaEnumDefinition must be available for the DataType. Otherwise an empty UaEnumDefinition is returned.
Implements UaDataTypeDictionary.
|
virtual |
Provides a way to export the namespace from the Server address space to the XML file represented by the AddressSpaceFileType.
Value attributes are only exported if they represent static configuration information. The client is expected to call the ExportNamespace method first to update the XML file and then access the file with the methods defined in the FileType.
Implements OpcUa::AddressSpaceFileCallback.
|
protected |
Find a UaNode by OpcUa_NodeId.
pNodeId | NodeId of the node to find. |
|
virtual |
Get the default permissions defined for this namespace.
The default implementation returns the permission for the namespace managed by the NodeManagerUaNode. The caller needs to call releaseReference on the returned NodeAccessInfo.
[in] | namespaceIndex | Requested namespace (ignored in the default implementation) |
Reimplemented from NodeManager.
Reimplemented in NodeManagerRoot.
|
pure virtual |
Get the responsible IOManager for the node and attribute combination.
pUaNode | the actual Node where to get all information from. |
attributeId | AttributeId of the requested node |
Implemented in NodeManagerBase.
|
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.
pSession | Interface to the Session context for the method call |
pObjectNodeId | The NodeId of the requested Object. The pointer to the NodeId is only valid during this call. |
pMethodNodeId | The NodeId of the requested Method. The pointer to the NodeId is only valid during this call. |
result | The result of the current Operation. |
Reimplemented from NodeManager.
Reimplemented in NodeManagerRoot.
|
inlinevirtual |
Get the namespace index of the NodeManager.
Implements NodeManagerConfig.
|
inlineprotected |
Gets the namespace URI of this NodeManager.
Get a UaNode pointer for a requested nodeId.
If a UaNode object is found for the nodeId, the reference count of the node is incremented and a pointer to the node is returned. The caller must release the reference when the node is no longer needed.
nodeId | NodeId of the node to return. |
Reimplemented in NodeManagerRoot.
|
virtual |
Gets the interface NodeManagerConfig if available.
Reimplemented from NodeManager.
Reimplemented in NodeManagerRoot.
|
virtual |
Get the interface NodeManagerCrossReferences if available.
Reimplemented from NodeManager.
Reimplemented in NodeManagerRoot.
|
virtual |
Gets the interface NodeManagerUaNode if available.
Reimplemented from NodeManager.
|
virtual |
Returns the UaNode factory for the namespace if supported by the NodeManager.
The caller of the method is responsible for deleting the returned object.
The default implementation returns NULL.
namespaceIndex | Namespace index assigned to the NodeManager. |
Reimplemented in OpcUaDi::NodeManagerDevicesBase, and OpcUaPlc::NodeManagerPLCopenBase.
|
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 incremented before returning the pointer.
pSession | Interface to the Session context for the method call. The Session object is reference counted. The Session is valid until the client has closed the Session or it timed out. If the Session pointer is stored in user objects, these objects must add their own reference. |
serviceType | Service type enumerator |
pNodeId | NodeId of the requested node. The pointer to the NodeId is only valid during this call. |
AttributeId | AttributeId of the requested node |
Implements NodeManager.
Reimplemented in NodeManagerRoot.
|
inline |
Checks whether the NodeManager is started or not.
|
virtual |
Returns the UaOptionSetDefinition for the specified data type.
Returns a null UaOptionSetDefinition if the data type is unknown or not an option set. Use UaOptionSetDefinition::isNull() to check for a null definition
Implements UaDataTypeDictionary.
OpcUa::NamespaceMetadataType * NodeManagerUaNode::pNamespaceMetaData | ( | ) | const |
Get the namespace metadata object if it was created.
Returns NULL if not created with createNamespaceMetaData.
|
protected |
Check if the exact same reference exists already.
The reference is considered identical if the SourceNode, the TargetNode and the ReferenceTypeId is the same.
|
virtual |
Remove a Role that was created by this NodeManager.
This decreases the ReferenceCounter of pRoleOperations.
pRoleTypeOperations | A pointer to the RoleOperation interface. |
Reimplemented from NodeManager.
void NodeManagerUaNode::setDataTypeVersion | ( | const UaString & | sDataTypeVersion | ) |
Sets the version of the dictionaries.
The method addTypeDictionary must be called before calling this method.
void NodeManagerUaNode::setDefaultMethodManager | ( | MethodManager * | pMethodManager | ) |
Sets a default MethodManager; used if Object does not implement MethodManager.
This MethodManager is used if object and method nodes were found but the object does not implement the MethodManager.
|
virtual |
Set the default permissions defined for this namespace.
[in] | pDefaultPermissions | New default permissions for the namespace |
Reimplemented in NodeManagerBase.
void NodeManagerUaNode::setFallbackMethodManager | ( | MethodManager * | pMethodManager | ) |
Set a fallback MethodManager; used if Object and Method are not available as UaNode.
This MethodManager is used if object and method were not found as UaNode, like for conditions without nodes in address space. This MethodManager is called with MethodHandleNodeId containing the NodeIds for object and method.
UaStatus NodeManagerUaNode::setTypeDictionary | ( | OpcUa::DataTypeDictionaryType * | pTypeDictionary | ) |
Adds a DataTypeDictionary to the Binary DataTypeSystem without adding nodes.
This method and addTypeDictionary must called at most one time for a NodeManager.
UaStatus NodeManagerUaNode::setXmlTypeDictionary | ( | OpcUa::DataTypeDictionaryType * | pTypeDictionary | ) |
Adds a DataTypeDictionary to the XML DataTypeSystem without adding nodes.
This method and addTypeDictionaryXml must called at most one time for a NodeManager.
|
virtual |
Shut down module.
Method is called during shut down of OPC Server and can be used to clean up the configuration of the module.
Implements UaServerApplicationModule.
|
virtual |
Start up NodeManager.
pServerManager | Interface 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. |
Implements UaServerApplicationModule.
Reimplemented in NodeManagerRoot, NodeManagerBase, and NodeManagerNS1.
|
virtual |
Returns the UaStructureDefinition for a specified DataType.
A UaStructureDefinition must be available for the DataType. Otherwise an empty UaStructureDefinition is returned.
Implements UaDataTypeDictionary.
|
virtual |
Translates a relative BrowsePath to a NodeId.
This method is used to translate a given browse path to a target NodeId. The result is a list of target NodeIds. In most cases there is just one result.
The browse path is consisting of a starting node and a RelativePath. The starting node identifies the Node from which the RelativePath is based. The RelativePath contains a sequence of BrowseNames.
The RelativePath parameter contains a list of RelativePathElements and the current position of the translate processing.
Translate can affect more than one NodeManager while the implementation of this method is only required to process RelativePathElements and starting nodes managed by the current NodeManager instance.
Expected behaviour for NodeManagers implementing translateBrowsePathToNodeId: A NodeManager can either process the complete RelativePath or just part of the RelativePath.
A NodeManager that finds references to other NodeManagers adds those to the list of NodeManagers in UaRelativePath by calling addNodeManagerToProcess. The SDK will then call translate on those NodeManagers using the startingNode and index from the UaTranslateBrowsePathContext.
A NodeManager shall never set or increment the currentPosition. This is done by the SDK calling the NodeManagers.
serviceContext | General context for the service calls containing information like the session object, return diagnostic mask and timeout hint. |
startingNode | Starting node for the current position of the relativePath. |
relativePath | Relative path received from the client for the translate. The current position of the path matches the startingNode. UaRelativePath::getElementAtCurrentPosition can be used if one element is processed in the implementation of translateBrowsePathToNodeId. UaRelativePath::getElementAt is used with UaRelativePath::currentPosition as starting index is used if more than one path element is procesed. |
browsePathTargets | All result target nodes for the browse path or the partial result for the already resolved part of the path. |
Implements NodeManager.
Reimplemented in NodeManagerRoot.
|
protected |
Used for managing custom Structured DataTypes and Enumerated DataTypes that are added during runtime.