open62541pp 0.17.0
C++ wrapper of open62541
Loading...
Searching...
No Matches
opcua::NodeId Class Reference

#include <types.hpp>

Inheritance diagram for opcua::NodeId:
[legend]

Detailed Description

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< UA_NodeId >
constexpr Wrapper () noexcept=default
 
constexpr Wrapper (const UA_NodeId &native) noexcept
 
constexpr Wrapper (UA_NodeId &&native) noexcept
 
constexpr Wrapperoperator= (const UA_NodeId &native) noexcept
 
constexpr Wrapperoperator= (UA_NodeId &&native) noexcept
 
constexpr operator UA_NodeId & () noexcept
 
constexpr operator const UA_NodeId & () const noexcept
 
constexpr UA_NodeIdoperator-> () noexcept
 
constexpr const UA_NodeIdoperator-> () const noexcept
 
constexpr UA_NodeIdhandle () noexcept
 
constexpr const UA_NodeIdhandle () const noexcept
 
constexpr void swap (Wrapper &other) noexcept
 
constexpr void swap (UA_NodeId &native) noexcept
 

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< UA_NodeId >
using NativeType
 
- Static Public Member Functions inherited from opcua::TypeWrapper< UA_NodeId, UA_TYPES_NODEID >
static constexpr TypeIndex typeIndex ()
 
- Protected Member Functions inherited from opcua::TypeWrapper< UA_NodeId, UA_TYPES_NODEID >
constexpr void clear () noexcept
 
- Protected Member Functions inherited from opcua::Wrapper< UA_NodeId >
constexpr const UA_NodeIdnative () const noexcept
 
constexpr UA_NodeIdnative () noexcept
 

Constructor & Destructor Documentation

◆ NodeId() [1/5]

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

Create NodeId with numeric identifier.

Definition at line 671 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 678 of file types.hpp.

◆ NodeId() [3/5]

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

Create NodeId with Guid identifier.

Definition at line 685 of file types.hpp.

◆ NodeId() [4/5]

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

Create NodeId with ByteString identifier.

Definition at line 692 of file types.hpp.

◆ NodeId() [5/5]

template<typename T , typename = std::enable_if_t<detail::IsNodeIdEnum<T>::value>>
opcua::NodeId::NodeId ( T 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 704 of file types.hpp.

Member Function Documentation

◆ isNull()

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

Definition at line 707 of file types.hpp.

◆ hash()

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

Definition at line 711 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 721 of file types.hpp.

◆ identifierType()

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

Definition at line 725 of file types.hpp.

Referenced by getIdentifierType(), and identifierIf().

◆ getIdentifierType()

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

Definition at line 731 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 746 of file types.hpp.

Referenced by identifier().

◆ 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 752 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 793 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 799 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 809 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 817 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 825 of file types.hpp.

◆ toString()

std::string opcua::NodeId::toString ( ) const

◆ TypeWrapper() [1/5]

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

◆ TypeWrapper() [2/5]

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]

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]

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

Copy constructor (deep copy).

Definition at line 43 of file typewrapper.hpp.

◆ TypeWrapper() [5/5]

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 872 of file types.hpp.

◆ 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.