CVB++ 14.0
VariableNode Class Reference

An OPCUA VariableNode object. It handles the data modeling acording to the OPCUA specification. More...

#include <cvb/opcua/variable_node.hpp>

Inherits BaseNode.

Inherited by FloatNode, IntegerNode, and StringNode.

Public Member Functions

OpcUa::DataType DataType () const
 
EventCookie RegisterWriteCallback (std::function< void()> handler)
 
EventCookie RegisterReadCallback (std::function< void()> handler)
 
void UnregisterCallback (EventCookie eventCookie)
 
- Public Member Functions inherited from BaseNode
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 VariableNode object. It handles the data modeling acording to the OPCUA specification.

Note
This node serves as the basis for OpcUa::StringNode and similar. It will also created/returned if no specific implementation for a VariableNode is available.
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/ServerClientInteraction.

Member Function Documentation

◆ DataType()

OpcUa::DataType DataType ( ) const
inline

/brief Returns the DataType of the stored data.

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

◆ RegisterReadCallback()

EventCookie RegisterReadCallback ( std::function< void()>  handler)
inline

/brief Registers a callback on read operations. The callback is of type: std::function<void()>, the usage of lambdas for dataaccess is highly recommended.

Note
The callback MUST be deregistered, otherwise internal object handles will not be closed.
Returns
A cookie for later deregistering the callback.
Exceptions
Anyexception derived from std::exception including CvbException and OpcUaException.

◆ RegisterWriteCallback()

EventCookie RegisterWriteCallback ( std::function< void()>  handler)
inline

/brief Registers a callback on write operations. The callback is of type std::function<void()>, the usage of lambdas for data access is highly recommended.

Note
The callback MUST be deregistered, otherwise internal object handles will not be closed.
Returns
A cookie for later deregistering the callback.
Exceptions
Anyexception derived from std::exception including CvbException and OpcUaException.

◆ UnregisterCallback()

void UnregisterCallback ( EventCookie  eventCookie)
inline

/brief Deregisters a callback.

Note
The callback MUST be deregistered, otherwise internal object handles will not be closed.
Parameters
[in]eventCookieThe cookie created at callback creation.
Exceptions
Anyexception derived from std::exception including CvbException and OpcUaException.