CVB++ 14.0
StringNode Class Reference

A node object with string values, provides an interface for storage and manipulation of strings (default std::string or std::wstring representation). More...

#include <cvb/opcua/string_node.hpp>

Inherits VariableNode.

Public Member Functions

Cvb::String Value () const
 Returns the saved value of the node. More...
 
void SetValue (const Cvb::String &value)
 Set value of the node to the given value. More...
 
- Public Member Functions inherited from VariableNode
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...
 

Static Public Member Functions

static StringNodePtr Create (std::uint16_t namespaceIndex, const Cvb::String &name, const OpcUa::NodeID &parentNodeID, Cvb::String value)
 Creates an OPCUA Variable with the specified parameter, data type and set its value as astring. More...
 

Detailed Description

A node object with string values, provides an interface for storage and manipulation of strings (default std::string or std::wstring representation).

Note
A derivative of OpcUa::BaseNode and OpcUa::VariableNode.
For details see OPCUA specification:
https://opcfoundation.org/developer-tools/specifications-unified-architecture/part-5-information-model/

Member Function Documentation

◆ Create()

static StringNodePtr Create ( std::uint16_t  namespaceIndex,
const Cvb::String name,
const OpcUa::NodeID parentNodeID,
Cvb::String  value 
)
inlinestatic

Creates an OPCUA Variable with the specified parameter, data type and set its value as astring.

Note
The OPCUA BaseNode which is created by this function has the default type definition OPCUA BaseVariableType. Further, the default reference type is OPCUA HasComponenent. Callbacks can be registered once the node has been added with Server::AddNode to a Server with VariableNode::RegisterWriteCallback or VariableNode::RegisterWriteCallback
Parameters
[in]namespaceIndexIndex of the namespace where the OPCUA BaseNode should belong to.
[in]nameString literal for non-localized, human-readable name of an OPCUA BaseNode.
[in]parentNodeIDOPCUA NodeId of the parent to which the OPCUA BaseNode belongs.
[in]valueSets the value of the OPCUA Variable as astring.
Returns
std::shared_ptr to a StringNode
Exceptions
Anyexception derived from std::exception including CvbException and OpcUaException.

◆ SetValue()

void SetValue ( const Cvb::String value)
inline

Set value of the node to the given value.

Parameters
[in]valueThe value of the node
Exceptions
Anyexception derived from std::exception including CvbException and OpcUaException.

◆ Value()

Cvb::String Value ( ) const
inline

Returns the saved value of the node.

Returns
the value of the node
Exceptions
Anyexception derived from std::exception including CvbException and OpcUaException.