UA Server SDK C++ Bundle
1.4.0.258
|
Class implementing the UaMethod interface for the Method handling. More...
#include <opcua_baseobjecttype.h>
Inherits UaMethod, and UaReferenceLists.
Public Member Functions | |
BaseMethod (UaNode *pParentNode, UaMethod *pInstanceDeclarationMethod, UaMutexRefCounted *pSharedMutex=NULL) | |
Construction of the class BaseMethod. More... | |
BaseMethod (const UaNodeId &nodeId, const UaString &name, OpcUa_UInt16 browseNameNameSpaceIndex, UaMutexRefCounted *pSharedMutex=NULL) | |
Construction of the class BaseMethod. More... | |
UaReferenceLists * | getUaReferenceLists () const |
Get the UaReferenceLists interface for the node. More... | |
virtual UaStatus | browse (const ServiceContext &serviceContext, BrowseContext &browseContext, UaReferenceDescriptions &References) |
Discover the references of a specified node of a view. More... | |
UaNodeId | nodeId () const |
Get the NodeId of the current Node. More... | |
virtual UaQualifiedName | browseName () const |
Get the browseName of the current Node. More... | |
virtual UaLocalizedText | displayName (Session *pSession) const |
Get the displayName as LocalizedText of the current Node. More... | |
virtual OpcUa_Boolean | isDescriptionSupported () const |
Check if Node is DescriptionSupported. More... | |
virtual UaLocalizedText | description (Session *pSession) const |
Get the description as LocalizedText of the current Node. More... | |
virtual OpcUa_Boolean | isWriteMaskSupported () const |
Check if Node is WriteMaskSupported. More... | |
virtual OpcUa_UInt32 | writeMask () const |
Get the writeMask of the current Node. More... | |
virtual OpcUa_Boolean | isUserWriteMaskSupported () const |
Check if Node is UserWriteMaskSupported. More... | |
virtual OpcUa_UInt32 | userWriteMask (Session *pSession) const |
Check if Node has a userWriteMask. More... | |
UaNode * | getUaNode () const |
Get the UaNode interface pointer of this node. More... | |
virtual OpcUa_Boolean | executable () const |
Indicates if Method is executable. More... | |
virtual OpcUa_Boolean | userExecutable (Session *pSession) const |
Indicates if method is executable by the user. More... | |
virtual void | setUserData (UserDataBase *pUserData) |
Method to set user data stored in this class. More... | |
virtual UserDataBase * | getUserData () const |
Method to get the user data stored in this class. More... | |
virtual void | setBrowseName (const UaQualifiedName &browseName) |
Sets the browse name attribute value. More... | |
virtual void | setDisplayName (const UaLocalizedText &displayName) |
Sets the display name attribute value. More... | |
virtual void | setDescription (const UaLocalizedText &description) |
Sets the description attribute value. More... | |
virtual void | setWriteMask (OpcUa_UInt32 writeMask) |
Sets the write mask attribute value. More... | |
virtual void | setExecutable (OpcUa_Boolean executable) |
Sets the executable attribute value. More... | |
virtual void | setModellingRuleId (const UaNodeId &modellingRuleId) |
Set NodeId of the modelling rule for this node. More... | |
virtual UaNodeId | modellingRuleId () const |
Get NodeId of the modeling rule for this node. More... | |
virtual UaStatus | setAttributeValue (Session *pSession, OpcUa_Int32 attributeId, const UaDataValue &dataValue, OpcUa_Boolean checkWriteMask) |
Sets the value of an attribute of the Node. More... | |
Public Member Functions inherited from UaMethod | |
UaMethod () | |
construction | |
OpcUa_NodeClass | nodeClass () const |
Get the NodeClass of the current Node. More... | |
virtual void | getAttributeValue (Session *pSession, OpcUa_Int32 attributeId, UaDataValue &uaDataValue) |
Gets the value of an attribute of the Node. More... | |
Public Member Functions inherited from UaNode | |
UaNode () | |
Construction of the UaNode. More... | |
virtual UaNodeId | getKey () const |
Get the key of the node used for the hash table. More... | |
virtual UaNodeId | typeDefinitionId () const |
Get NodeId of the type definition node for this node. More... | |
Public Member Functions inherited from ChainEntry | |
ChainEntry () | |
construction | |
ChainEntry * | find (const UaNodeId &key, ChainEntry **ppPrevious) |
finds the right entry in the chain. More... | |
void | add (ChainEntry *pNewEntry) |
adds a new entry to the list. More... | |
void | prepend (ChainEntry *pNewEntry) |
prepends a new entry to the list. More... | |
ChainEntry * | remove (const UaNodeId &key, ChainEntry **ppNext) |
removes an entry from the list. More... | |
ChainEntry * | getNext () const |
Check if there is a chain. More... | |
virtual void | setInvalid () |
Set the entry to invalid. More... | |
Public Member Functions inherited from ReferenceCounter | |
ReferenceCounter () | |
construction | |
virtual | ~ReferenceCounter () |
destruction | |
int | addReference () |
int | releaseReference () |
int | referenceCount () const |
Public Member Functions inherited from UaReferenceLists | |
UaReferenceLists () | |
Constructs the reference lists object. | |
virtual | ~UaReferenceLists () |
Destroys the reference lists object. | |
virtual UaStatus | browseReferences (const ServiceContext &serviceContext, BrowseContext &browseContext, UaReferenceDescriptions &References) |
Discover the references of a specified node of a view. More... | |
virtual UaStatus | translateBrowsePathToNodeId (const ServiceContext &serviceContext, const UaNodeId &startingNode, UaRelativePath &relativePath, UaBrowsePathTargets &browsePathTargets) |
Find a node based on an element of an relative path. More... | |
virtual const UaReference * | pTargetNodes () const |
Returns the list of references to target nodes. More... | |
virtual const UaReference * | pSourceNodes () const |
Returns the list of references to source nodes. More... | |
virtual UaNode * | getTargetNodeByBrowseName (const UaQualifiedName &browseName) const |
Searches a target node with the passed browse name and returns the UaNode interface if found. More... | |
virtual void | addTargetNode (UaReference *pReference) |
Add a reference to a target node where this node is the source node. More... | |
virtual void | addSourceNode (UaReference *pReference) |
Adds a reference to a source node where this node is the target node. More... | |
virtual UaStatus | removeSourceNode (UaReference *pReferenceToRemove) |
Remove a reference to a source node where this node is the target node. More... | |
virtual bool | removeSourceReference (UaReference *pReferenceToRemove) |
Remove the passed reference to a source node. More... | |
virtual UaStatus | removeTargetNode (UaNode *pTargetNode, const UaNodeId &referenceTypeId, OpcUa_Boolean deleteBidirectional) |
Remove a reference to a target node where this node is the source node. More... | |
virtual UaStatus | removeTargetNode (const UaNodeId &targetNodeId, const UaNodeId &referenceTypeId, OpcUa_Boolean deleteBidirectional) |
Remove a reference to a target node where this node is the source node. More... | |
virtual bool | removeTargetReference (UaReference *pReferenceToRemove) |
Remove the passed reference to a target node. More... | |
virtual UaStatus | removeCrossNodeManagerRef (NodeManager *pNodeManager) |
Remove references to another NodeManager. More... | |
virtual UaStatus | invalidateSourceReferences (OpcUa_Boolean deleteSourceReferences) |
Set all references from SourceNodes to this Node invalid. More... | |
virtual UaStatus | invalidateTargetReferences (OpcUa_Boolean deleteTargetReferences) |
Set all references to TargetNode of this node invalid. More... | |
virtual UaStatus | deleteAllChildren (NodeManagerConfig *pNodeManagerConfig) |
Deletes all child nodes. More... | |
Protected Member Functions | |
virtual | ~BaseMethod () |
Destruction of the BaseMethod. More... | |
Protected Member Functions inherited from UaMethod | |
virtual | ~UaMethod () |
destruction | |
Protected Member Functions inherited from UaNode | |
virtual | ~UaNode () |
Destruction of the UaNode. More... | |
Protected Member Functions inherited from ChainEntry | |
virtual | ~ChainEntry () |
destruction | |
Protected Attributes | |
UaMutexRefCounted * | m_pSharedMutex |
Protected Attributes inherited from UaReferenceLists | |
UaReference * | m_pTargetNodes |
List of references to target nodes where this node is the source node. More... | |
UaReference * | m_pLastTargetNode |
Last references in the list of references to the target nodes. More... | |
UaReference * | m_pSourceNodes |
List of references to source nodes where this node is the target node. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from UaMethod | |
static int | s_instanceCount = 0 |
Class implementing the UaMethod interface for the Method handling.
OPC UA Methods are used to represent methods that can be called on objects.
|
protectedvirtual |
Destruction of the BaseMethod.
The Method is reference counted and can not be deleted directly. The methods addReference and releaseReference are used to manage the reference to this Method.
OpcUa::BaseMethod::BaseMethod | ( | UaNode * | pParentNode, |
UaMethod * | pInstanceDeclarationMethod, | ||
UaMutexRefCounted * | pSharedMutex = NULL |
||
) |
Construction of the class BaseMethod.
This constructor is used if the Method is created based on an instance declaration of an Method type. Since the only difference between the instance declaration Method and the instance Method are the NodeId, the pointer to the instance declaration node is used to get the attribute values other than NodeId from the instance declaration node.
The Method is reference counted and can not be deleted directly. The reference counter is set to one after the Method is created. If the Method was successfully added to a NodeManager using the methods NodeManagerConfig::addUaNode or NodeManagerConfig::addNodeAndReference the NodeManager will release this reference during shut down. If the Method was not added to a NodeManager, it must be deleted using the releaseReference method. If the interface pointer is used in other places, the availability of the Method must be ensured by incrementing the reference counter with addReference when the pointer is stored somewhere and decremented with releaseReference if the interface pointer is not longer needed.
[in] | pParentNode | Parent node of the new method |
[in] | pInstanceDeclarationMethod | UaMethod interface of the instance declaration node used to provide attribute values other than NodeId |
[in] | pSharedMutex | Shared mutex Method used to synchronize access to the Method. Can be NULL if no shared mutex is provided |
OpcUa::BaseMethod::BaseMethod | ( | const UaNodeId & | nodeId, |
const UaString & | name, | ||
OpcUa_UInt16 | browseNameNameSpaceIndex, | ||
UaMutexRefCounted * | pSharedMutex = NULL |
||
) |
Construction of the class BaseMethod.
This constructor is used if the Method is not created based on an instance declaration. It defines the name and node id of the Method. Additional language specific names and other attribute values can be set with set methods provided by the class. The Method is reference counted and can not be deleted directly. The reference counter is set to one after the Method is created. If the Method was successfully added to a NodeManager using the methods NodeManagerConfig::addUaNode or NodeManagerConfig::addNodeAndReference the NodeManager will release this reference during shut down. If the Method was not added to a NodeManager, it must be deleted using the releaseReference method. If the interface pointer is used in other places, the availability of the Method must be ensured by incrementing the reference counter with addReference when the pointer is stored somewhere and decremented with releaseReference if the interface pointer is not longer needed.
[in] | nodeId | NodeId of the new Method |
[in] | name | Name of the new Method. Used as browse name and also as display name if no additional language specific names are set. |
[in] | browseNameNameSpaceIndex | Namespace index used for the browse name |
[in] | pSharedMutex | Shared mutex Method used to synchronize access to the Method. Can be NULL if no shared mutex is provided |
|
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 calls containing information like the session Method, return diagnostic mask and timeout hint. |
browseContext | Browse context for the first browse or the following browse with continuation point. |
References | Array of ReferenceDescription results for the browsed node. |
Implements UaNode.
|
virtual |
Get the browseName of the current Node.
Implements UaNode.
|
virtual |
|
virtual |
|
virtual |
|
inlinevirtual |
Get the UaNode interface pointer of this node.
Implements UaReferenceLists.
|
inlinevirtual |
Get the UaReferenceLists interface for the node.
The UaReferenceLists interface is used to manage and to access the references from and to this node.
Reimplemented from UaNode.
|
virtual |
Method to get the user data stored in this class.
This is typically used to store information necessary to store application specific informationto for the method access or method execution.
Reimplemented from UaNode.
|
virtual |
|
virtual |
Check if Node is UserWriteMaskSupported.
Implements UaNode.
|
virtual |
|
virtual |
Get NodeId of the modeling rule for this node.
Only instance declaration nodes like Methods, Variables or Methods have modeling rules type definition nodes. This method provides a shortcut to get the modeling rule of a node. This information is available for a client by following the HasModellingRule reference (Browse or TranslateBrowsePathToNodeIds) from this node. The HasModellingRule reference is normally not contained in the list of references for the nodes and is handled by the SDK using this method. Creating the reference as normal reference instead of using this shortcut is also possible. The default implementation of this method returns a null NodeId which means there is no modeling rule defined. The method must be overwritten in a derived class to return a modeling rule.
Reimplemented from UaNode.
|
virtual |
|
virtual |
Sets the value of an attribute of the Node.
[in] | pSession | Interface to the Session context for the method call |
[in] | attributeId | Attribute id indicating the attribute to set |
[in] | dataValue | New value for the attribute |
[out] | checkWriteMask | Flag indicating if the write mask of the node should be checked before setting the new value |
Reimplemented from UaNode.
|
virtual |
Sets the browse name attribute value.
browseName | the browse name of the current Node |
|
virtual |
Sets the description attribute value.
description | the description of the server. |
|
virtual |
Sets the display name attribute value.
displayName | the display name of a node. |
|
virtual |
Sets the executable attribute value.
executable | True if executable False if not |
|
virtual |
Set NodeId of the modelling rule for this node.
|
virtual |
Method to set user data stored in this class.
This is typically used to store information necessary to store application specific informationto for the method access or method execution.
[in] | pUserData | User data to set |
Reimplemented from UaNode.
|
virtual |
Sets the write mask attribute value.
writeMask | the write mask of the node. |
|
virtual |
|
virtual |
|
virtual |