open62541pp 0.18.0
C++ wrapper of open62541
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Related Symbols | List of all members
opcua::NodeId Class Reference

#include <types.hpp>

Inheritance diagram for opcua::NodeId:
[legend]

Detailed Description

UA_NodeId wrapper class.

See also
https://reference.opcfoundation.org/Core/Part3/v105/docs/8.2
Examples
events/client_eventfilter.cpp, server_accesscontrol.cpp, server_datasource.cpp, and server_valuecallback.cpp.

Definition at line 665 of file types.hpp.

Public Member Functions

 NodeId (NamespaceIndex namespaceIndex, uint32_t identifier) noexcept
 
 NodeId (NamespaceIndex namespaceIndex, std::string_view identifier)
 
 NodeId (NamespaceIndex namespaceIndex, Guid identifier) noexcept
 
 NodeId (NamespaceIndex namespaceIndex, ByteString identifier) noexcept
 
template<typename T , typename = std::enable_if_t<detail::IsNodeIdEnum<T>::value>>
 NodeId (T identifier) noexcept
 
bool isNull () const noexcept
 
uint32_t hash () const noexcept
 
NamespaceIndex namespaceIndex () const noexcept
 
NamespaceIndex getNamespaceIndex () const noexcept
 
NodeIdType identifierType () const noexcept
 
NodeIdType getIdentifierType () const noexcept
 
template<typename T >
T * identifierIf () noexcept
 
template<typename T >
const T * identifierIf () const noexcept
 
template<typename T >
T & identifier ()
 
template<typename T >
const T & identifier () const
 
std::variant< uint32_t, String, Guid, ByteStringgetIdentifier () const
 
template<typename T >
auto getIdentifierAs () const
 
template<NodeIdType E>
auto getIdentifierAs () const
 
std::string toString () const
 
constexpr TypeWrapper () noexcept=default
 
constexpr TypeWrapper (const T &native)
 
constexpr TypeWrapper (T &&native) noexcept
 
constexpr TypeWrapper (const TypeWrapper &other)
 
constexpr TypeWrapper (TypeWrapper &&other) noexcept
 
- Public Member Functions inherited from opcua::TypeWrapper< UA_NodeId, UA_TYPES_NODEID >
constexpr TypeWrapper () noexcept=default
 
constexpr TypeWrapper (const UA_NodeId &native)
 
constexpr TypeWrapper (UA_NodeId &&native) noexcept
 
constexpr TypeWrapper (const TypeWrapper &other)
 
constexpr TypeWrapper (TypeWrapper &&other) noexcept
 
 ~TypeWrapper ()
 
constexpr TypeWrapperoperator= (const TypeWrapper &other)
 
constexpr TypeWrapperoperator= (const UA_NodeId &native)
 
constexpr TypeWrapperoperator= (TypeWrapper &&other) noexcept
 
constexpr TypeWrapperoperator= (UA_NodeId &&native) noexcept
 
- Public Member Functions inherited from opcua::Wrapper< T >
constexpr Wrapper () noexcept=default
 
constexpr Wrapper (const T &native) noexcept
 
constexpr Wrapper (T &&native) noexcept
 
constexpr Wrapperoperator= (const T &native) noexcept
 
constexpr Wrapperoperator= (T &&native) noexcept
 
constexpr operator T& () noexcept
 
constexpr operator const T & () const noexcept
 
constexpr T * operator-> () noexcept
 
constexpr const T * operator-> () const noexcept
 
constexpr T * handle () noexcept
 
constexpr const T * handle () const noexcept
 
constexpr void swap (Wrapper &other) noexcept
 
constexpr void swap (T &native) noexcept
 

Static Public Member Functions

static NodeId parse (std::string_view str)
 
- Static Public Member Functions inherited from opcua::TypeWrapper< UA_NodeId, UA_TYPES_NODEID >
static constexpr TypeIndex typeIndex ()
 

Related Symbols

(Note that these are not member symbols.)

bool operator== (const UA_NodeId &lhs, const UA_NodeId &rhs) noexcept
 
bool operator!= (const UA_NodeId &lhs, const UA_NodeId &rhs) noexcept
 
bool operator< (const UA_NodeId &lhs, const UA_NodeId &rhs) noexcept
 
bool operator> (const UA_NodeId &lhs, const UA_NodeId &rhs) noexcept
 
bool operator<= (const UA_NodeId &lhs, const UA_NodeId &rhs) noexcept
 
bool operator>= (const UA_NodeId &lhs, const UA_NodeId &rhs) noexcept
 

Additional Inherited Members

- Public Types inherited from opcua::Wrapper< T >
using NativeType = T
 
- Protected Member Functions inherited from opcua::TypeWrapper< UA_NodeId, UA_TYPES_NODEID >
constexpr void clear () noexcept
 
- Protected Member Functions inherited from opcua::Wrapper< T >
constexpr const T & native () const noexcept
 
constexpr T & native () noexcept
 

Constructor & Destructor Documentation

◆ NodeId() [1/5]

opcua::NodeId::NodeId ( NamespaceIndex  namespaceIndex,
uint32_t  identifier 
)
inlinenoexcept

Create NodeId with numeric identifier.

Definition at line 670 of file types.hpp.

◆ NodeId() [2/5]

opcua::NodeId::NodeId ( NamespaceIndex  namespaceIndex,
std::string_view  identifier 
)
inline

Create NodeId with String identifier.

Definition at line 677 of file types.hpp.

◆ NodeId() [3/5]

opcua::NodeId::NodeId ( NamespaceIndex  namespaceIndex,
Guid  identifier 
)
inlinenoexcept

Create NodeId with Guid identifier.

Definition at line 684 of file types.hpp.

◆ NodeId() [4/5]

opcua::NodeId::NodeId ( NamespaceIndex  namespaceIndex,
ByteString  identifier 
)
inlinenoexcept

Create NodeId with ByteString identifier.

Definition at line 691 of file types.hpp.

◆ NodeId() [5/5]

template<typename T , typename = std::enable_if_t<detail::IsNodeIdEnum<T>::value>>
opcua::NodeId::NodeId ( identifier)
inlinenoexcept

Create NodeId from enum class with numeric identifiers like opcua::ObjectId.

The namespace is retrieved by calling e.g. namespaceOf(opcua::ObjectId). Make sure to provide an overload for custom enum types.

Definition at line 703 of file types.hpp.

Member Function Documentation

◆ parse()

static NodeId opcua::NodeId::parse ( std::string_view  str)
inlinestatic

Parse NodeId from its string representation.

Format: ns=<namespaceindex>;<type>=<value>, e.g. i=13 or ns=10;s=HelloWorld

See also
https://reference.opcfoundation.org/Core/Part6/v104/docs/5.3.1.10

Definition at line 710 of file types.hpp.

◆ isNull()

bool opcua::NodeId::isNull ( ) const
inlinenoexcept

Definition at line 717 of file types.hpp.

◆ hash()

uint32_t opcua::NodeId::hash ( ) const
inlinenoexcept

Definition at line 721 of file types.hpp.

◆ namespaceIndex()

NamespaceIndex opcua::NodeId::namespaceIndex ( ) const
inlinenoexcept

◆ getNamespaceIndex()

NamespaceIndex opcua::NodeId::getNamespaceIndex ( ) const
inlinenoexcept
Deprecated:
Use namespaceIndex() instead

Definition at line 731 of file types.hpp.

◆ identifierType()

NodeIdType opcua::NodeId::identifierType ( ) const
inlinenoexcept

Definition at line 735 of file types.hpp.

Referenced by getIdentifierType(), and identifierIf().

◆ getIdentifierType()

NodeIdType opcua::NodeId::getIdentifierType ( ) const
inlinenoexcept
Deprecated:
Use identifierType() instead

Definition at line 741 of file types.hpp.

◆ identifierIf() [1/2]

template<typename T >
T * opcua::NodeId::identifierIf ( )
inlinenoexcept

Get identifier pointer or nullptr on error.

Template Parameters
TRequested identifier type, should be either:
Returns
Pointer to the stored identifier or a nullptr if T doesn't match the stored identifier type

Definition at line 756 of file types.hpp.

◆ identifierIf() [2/2]

template<typename T >
const T * opcua::NodeId::identifierIf ( ) const
inlinenoexcept

Get identifier pointer or nullptr on error.

Template Parameters
TRequested identifier type, should be either:
Returns
Pointer to the stored identifier or a nullptr if T doesn't match the stored identifier type

Definition at line 762 of file types.hpp.

◆ identifier() [1/2]

template<typename T >
T & opcua::NodeId::identifier ( )
inline

Get identifier reference.

Template Parameters
TRequested identifier type, should be either:
Returns
Reference to the stored identifier
Exceptions
TypeErrorIf the requested type T doesn't match the stored identifier type

Definition at line 801 of file types.hpp.

Referenced by identifierIf(), NodeId(), NodeId(), NodeId(), NodeId(), and opcua::DataType::setBinaryEncodingId().

◆ identifier() [2/2]

template<typename T >
const T & opcua::NodeId::identifier ( ) const
inline

Get identifier reference.

Template Parameters
TRequested identifier type, should be either:
Returns
Reference to the stored identifier
Exceptions
TypeErrorIf the requested type T doesn't match the stored identifier type

Definition at line 807 of file types.hpp.

◆ getIdentifier()

std::variant< uint32_t, String, Guid, ByteString > opcua::NodeId::getIdentifier ( ) const
inline

Get identifier variant.

Deprecated:
Use identifier<T>() or identifierIf<T>() instead

Definition at line 817 of file types.hpp.

◆ getIdentifierAs() [1/2]

template<typename T >
auto opcua::NodeId::getIdentifierAs ( ) const
inline

Get identifier by template type.

Deprecated:
Use identifier<T>() or identifierIf<T>() instead

Definition at line 825 of file types.hpp.

◆ getIdentifierAs() [2/2]

template<NodeIdType E>
auto opcua::NodeId::getIdentifierAs ( ) const
inline

Get identifier by NodeIdType enum.

Deprecated:
Use identifier<T>() or identifierIf<T>() instead

Definition at line 833 of file types.hpp.

◆ toString()

std::string opcua::NodeId::toString ( ) const
Deprecated:
Use free function opcua::toString(const T&) instead

◆ TypeWrapper() [1/5]

constexpr opcua::TypeWrapper< T, Index >::TypeWrapper ( )
constexprdefaultnoexcept

◆ TypeWrapper() [2/5]

constexpr opcua::TypeWrapper< T, Index >::TypeWrapper ( const T &  native)
inlineexplicitconstexpr

Constructor with native object (deep copy).

Definition at line 31 of file typewrapper.hpp.

◆ TypeWrapper() [3/5]

constexpr opcua::TypeWrapper< T, Index >::TypeWrapper ( T &&  native)
inlineconstexprnoexcept

Constructor with native object (move rvalue).

Definition at line 35 of file typewrapper.hpp.

◆ TypeWrapper() [4/5]

constexpr opcua::TypeWrapper< T, Index >::TypeWrapper ( const TypeWrapper other)
inlineconstexpr

Copy constructor (deep copy).

Definition at line 43 of file typewrapper.hpp.

◆ TypeWrapper() [5/5]

constexpr opcua::TypeWrapper< T, Index >::TypeWrapper ( TypeWrapper &&  other)
inlineconstexprnoexcept

Move constructor.

Definition at line 47 of file typewrapper.hpp.

Friends And Related Symbol Documentation

◆ operator==()

bool operator== ( const UA_NodeId lhs,
const UA_NodeId rhs 
)
related

Definition at line 877 of file types.hpp.

◆ operator!=()

bool operator!= ( const UA_NodeId lhs,
const UA_NodeId rhs 
)
related

Definition at line 882 of file types.hpp.

◆ operator<()

bool operator< ( const UA_NodeId lhs,
const UA_NodeId rhs 
)
related

Definition at line 887 of file types.hpp.

◆ operator>()

bool operator> ( const UA_NodeId lhs,
const UA_NodeId rhs 
)
related

Definition at line 892 of file types.hpp.

◆ operator<=()

bool operator<= ( const UA_NodeId lhs,
const UA_NodeId rhs 
)
related

Definition at line 897 of file types.hpp.

◆ operator>=()

bool operator>= ( const UA_NodeId lhs,
const UA_NodeId rhs 
)
related

Definition at line 902 of file types.hpp.