Public Member Functions | List of all members
BaseNode Class Reference

An OPCUA BaseNode. This is the base for all other node classes. For instantiation of a specific node type use one of the specific subclasses. There is no public interface to create a BaseNode. More...

#include <cvb/opcua/base_node.hpp>

Inherits enable_shared_from_this< OpcUa::BaseNode >.

Inherited by MethodNode, ObjectNode, and VariableNode.

Public Member Functions

void * Handle () const noexcept
 Returns C-API style handle to BaseNode Object. More...
 
OpcUa::NodeIDPtr NodeID () const
 Returns the OPCUA NodeID of an OPCUA BaseNode object. More...
 
String BrowseName () const
 Returns the browse name of an OPCUA BaseNode object. More...
 
std::vector< NodeIDPtrBrowse (const BrowseFilter &filter) const
 "Browse" all referenced BaseNodes of this BaseNode. More...
 
String DisplayName () const
 Returns the humanreadable name of a node. More...
 
OpcUa::NodeClass NodeClass () const
 Returns the NodeClass of an OPCUA BaseNode object. More...
 
OpcUa::ConnectionStatus ConnectionStatus () const
 Returns the ConnectionStatus of an OPCUA BaseNode object. More...
 
OpcUa::Access Access () const
 Returns the Access right to an OPCUA BaseNode object. More...
 
String Description () const
 Returns the description OPCUA BaseNode object. More...
 
void AddReference (const OpcUa::BaseNode &destination, const ReferenceType reference, ReferenceDirection direction) const
 Adds a Reference to the OPCUA node. More...
 
std::int64_t GetAttributeAsInt (AttributeID attributeID) const
 Return specific Information about a Opcua::BaseNode. More...
 
void SetAttributeAsInt (AttributeID attributeID, std::int64_t value)
 Set specific Information about a Opcua::BaseNode. More...
 
double GetAttributeAsFloat (AttributeID attributeID) const
 Return specific Information about a Opcua::BaseNode. More...
 
void SetAttributeAsFloat (AttributeID attributeID, double value)
 Set specific Information about a Opcua::BaseNode. More...
 
String GetAttributeAsString (AttributeID attributeID) const
 Return specific Information about a Opcua::BaseNode. More...
 
void SetAttributeAsString (AttributeID attributeID, const String &value)
 Set specific Information about a Opcua::BaseNode. More...
 

Detailed Description

An OPCUA BaseNode. This is the base for all other node classes. For instantiation of a specific node type use one of the specific subclasses. There is no public interface to create a BaseNode.

Note
OPCUA nodes are available for different node classes For details refer to:
https://opcfoundation.org/developer-tools/specifications-unified-architecture/part-5-information-model/
Examples
OpcUa/BareboneClient, and OpcUa/ServerClientInteraction.

Member Function Documentation

◆ Access()

OpcUa::Access Access ( ) const
inline

Returns the Access right to an OPCUA BaseNode object.

Returns
Access of the given OPCUA BaseNode.
Exceptions
Anyexception derived from std::exception including CvbException and OpcUaException.

◆ AddReference()

void AddReference ( const OpcUa::BaseNode destination,
const ReferenceType  reference,
ReferenceDirection  direction 
) const
inline

Adds a Reference to the OPCUA node.

Note
References defined relations between OPCUA nodes. It is possible to have multiple references inbetween nodes.
Parameters
[in]destinationOPCUA BaseNode that is the destination of the reference.
[in]referenceOPCUA ReferenceType of a certain ReferenceType that defines the relationship between two nodes. Example: Has_Component or Has_SubType
[in]directionflag that defines, if the reference is forward reference.
Exceptions
Anyexception derived from std::exception including CvbException and OpcUaException.

◆ Browse()

std::vector< NodeIDPtr > Browse ( const BrowseFilter filter) const
inline

"Browse" all referenced BaseNodes of this BaseNode.

Note
See OpcUa::BrowseFilter for further browsing options.
For further Information: https://opcfoundation.org/developer-tools/specifications-unified-architecture/part-4-services/
Attention
The Client must be connected to an Server to succeed.
A Browse operation is only valid on node extracted via a client.
Parameters
[in]filterParameters for browsing.
Returns
The result of the browse operation.
Exceptions
Anyexception derived from std::exception including CvbException and OpcUaException.

◆ BrowseName()

String BrowseName ( ) const
inline

Returns the browse name of an OPCUA BaseNode object.

Returns
OPCUA BrowseName of the given OPCUA BaseNode.
Exceptions
Anyexception derived from std::exception including CvbException and OpcUaException.

◆ ConnectionStatus()

Returns the ConnectionStatus of an OPCUA BaseNode object.

Returns
ConnectionStatus of the given OPCUA BaseNode.
Exceptions
Anyexception derived from std::exception including CvbException and OpcUaException.

◆ Description()

String Description ( ) const
inline

Returns the description OPCUA BaseNode object.

Returns
Description.
Exceptions
Anyexception derived from std::exception including CvbException and OpcUaException.

◆ DisplayName()

String DisplayName ( ) const
inline

Returns the humanreadable name of a node.

Returns
DisplayName of the given OPCUA BaseNode.
Exceptions
Anyexception derived from std::exception including CvbException and OpcUaException.
Examples
OpcUa/BareboneClient, and OpcUa/ServerClientInteraction.

◆ GetAttributeAsFloat()

double GetAttributeAsFloat ( AttributeID  attributeID) const
inline

Return specific Information about a Opcua::BaseNode.

Note
Try avoiding this function if possible. Most information is already available via other Methods (such as Opcua::BaseNode::DisplayName()).
Furthermore not all information makes sense/is available for OpcUa::BaseNodes, some information might be applicable to Opcua::FloatNode, but not for OpcUa::ObjectNode. Again, try using methods in the appropriate subclass of OpcUa::BaseNode.
Parameters
[in]attributeIDIdentifier for the desired information. See OpcUa::AttributeID.
Returns
the desired information

◆ GetAttributeAsInt()

std::int64_t GetAttributeAsInt ( AttributeID  attributeID) const
inline

Return specific Information about a Opcua::BaseNode.

Note
Try avoiding this function if possible. Most information is already available via other Methods (such as Opcua::BaseNode::DisplayName()).
Furthermore not all information makes sense/is available for OpcUa::BaseNodes, some information might be applicable to Opcua::FloatNode, but not for OpcUa::ObjectNode. Again, try using methods in the appropriate subclass of OpcUa::BaseNode.
Parameters
[in]attributeIDIdentifier for the desired information. See OpcUa::AttributeID.
Returns
the desired information

◆ GetAttributeAsString()

String GetAttributeAsString ( AttributeID  attributeID) const
inline

Return specific Information about a Opcua::BaseNode.

Note
Try avoiding this function if possible. Most information is already available via other Methods (such as Opcua::BaseNode::DisplayName()).
Furthermore not all information makes sense/is available for OpcUa::BaseNodes, some information might be applicable to Opcua::FloatNode, but not for OpcUa::ObjectNode. Again, try using methods in the appropriate subclass of OpcUa::BaseNode.
Parameters
[in]attributeIDIdentifier for the desired information. See OpcUa::AttributeID.
Returns
the desired information

◆ Handle()

void* Handle ( ) const
inlinenoexcept

Returns C-API style handle to BaseNode Object.

Returns
C-API handle

◆ NodeClass()

OpcUa::NodeClass NodeClass ( ) const
inline

Returns the NodeClass of an OPCUA BaseNode object.

Returns
OPCUA NodeClass of the given OPCUA BaseNode.
Exceptions
Anyexception derived from std::exception including CvbException and OpcUaException.

◆ NodeID()

OpcUa::NodeIDPtr NodeID ( ) const
inline

Returns the OPCUA NodeID of an OPCUA BaseNode object.

Returns
OPCUA NodeId of the given OPCUA BaseNode.
Exceptions
Anyexception derived from std::exception including CvbException and OpcUaException.

◆ SetAttributeAsFloat()

void SetAttributeAsFloat ( AttributeID  attributeID,
double  value 
)
inline

Set specific Information about a Opcua::BaseNode.

Note
Try avoiding this function if possible. Most information is already available via other Methods (such as Opcua::BaseNode::DisplayName()).
Furthermore not all information makes sense/is available for OpcUa::BaseNodes, some information might be applicable to Opcua::FloatNode, but not for OpcUa::ObjectNode. Again, try using methods in the appropriate subclass of OpcUa::BaseNode.
Parameters
[in]attributeIDIdentifier for the desired information. See OpcUa::AttributeID.
[in]valueNew value of the attribute

◆ SetAttributeAsInt()

void SetAttributeAsInt ( AttributeID  attributeID,
std::int64_t  value 
)
inline

Set specific Information about a Opcua::BaseNode.

Note
Try avoiding this function if possible. Most information is already available via other Methods (such as Opcua::BaseNode::DisplayName()).
Furthermore not all information makes sense/is available for OpcUa::BaseNodes, some information might be applicable to Opcua::FloatNode, but not for OpcUa::ObjectNode. Again, try using methods in the appropriate subclass of OpcUa::BaseNode.
Parameters
[in]attributeIDIdentifier for the desired information. See OpcUa::AttributeID.
[in]valueNew value of the attribute

◆ SetAttributeAsString()

void SetAttributeAsString ( AttributeID  attributeID,
const String value 
)
inline

Set specific Information about a Opcua::BaseNode.

Note
Try avoiding this function if possible. Most information is already available via other Methods (such as Opcua::BaseNode::DisplayName()).
Furthermore not all information makes sense/is available for OpcUa::BaseNodes, some information might be applicable to Opcua::FloatNode, but not for OpcUa::ObjectNode. Again, try using methods in the appropriate subclass of OpcUa::BaseNode.
Parameters
[in]attributeIDIdentifier for the desired information. See OpcUa::AttributeID.
[in]valueNew value of the attribute