open62541pp 0.16.0
C++ wrapper of open62541
Loading...
Searching...
No Matches
opcua::TypeWrapper< T, typeIndex > Class Template Reference

#include <typewrapper.hpp>

Inheritance diagram for opcua::TypeWrapper< T, typeIndex >:
[legend]

Detailed Description

template<typename T, TypeIndex typeIndex>
class opcua::TypeWrapper< T, typeIndex >

Template base class to wrap UA_* type objects.

Zero cost abstraction to wrap the C API objects and delete them on destruction. The derived classes should implement specific constructors to convert from other data types.

Warning
No virtual constructor defined, don't implement a destructor in the derived classes.

Definition at line 24 of file typewrapper.hpp.

Public Member Functions

constexpr TypeWrapper ()=default
 
constexpr TypeWrapper (const T &native)
 
constexpr TypeWrapper (T &&native) noexcept
 
 ~TypeWrapper ()
 
constexpr TypeWrapper (const TypeWrapper &other)
 
constexpr TypeWrapper (TypeWrapper &&other) noexcept
 
constexpr TypeWrapperoperator= (const TypeWrapper &other)
 
constexpr TypeWrapperoperator= (const T &native)
 
constexpr TypeWrapperoperator= (TypeWrapper &&other) noexcept
 
constexpr TypeWrapperoperator= (T &&native) noexcept
 
constexpr void swap (TypeWrapper &other) noexcept
 
constexpr void swap (T &native) noexcept
 
- Public Member Functions inherited from opcua::Wrapper< T >
constexpr Wrapper ()=default
 
constexpr Wrapper (const T &native)
 
constexpr Wrapper (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
 

Static Public Member Functions

static constexpr TypeIndex getTypeIndex ()
 

Protected Member Functions

constexpr void clear () noexcept
 
- Protected Member Functions inherited from opcua::Wrapper< T >
constexpr const T & native () const noexcept
 
constexpr T & native () noexcept
 

Additional Inherited Members

- Public Types inherited from opcua::Wrapper< T >
using NativeType = T
 

Constructor & Destructor Documentation

◆ TypeWrapper() [1/5]

template<typename T , TypeIndex typeIndex>
opcua::TypeWrapper< T, typeIndex >::TypeWrapper ( )
constexprdefault

◆ TypeWrapper() [2/5]

template<typename T , TypeIndex typeIndex>
opcua::TypeWrapper< T, typeIndex >::TypeWrapper ( const T & native)
inlineexplicitconstexpr

Constructor with native object (deep copy).

Definition at line 31 of file typewrapper.hpp.

◆ TypeWrapper() [3/5]

template<typename T , TypeIndex typeIndex>
opcua::TypeWrapper< T, typeIndex >::TypeWrapper ( T && native)
inlineconstexprnoexcept

Constructor with native object (move rvalue).

Definition at line 35 of file typewrapper.hpp.

◆ ~TypeWrapper()

template<typename T , TypeIndex typeIndex>
opcua::TypeWrapper< T, typeIndex >::~TypeWrapper ( )
inline

Definition at line 38 of file typewrapper.hpp.

◆ TypeWrapper() [4/5]

template<typename T , TypeIndex typeIndex>
opcua::TypeWrapper< T, typeIndex >::TypeWrapper ( const TypeWrapper< T, typeIndex > & other)
inlineconstexpr

Copy constructor (deep copy).

Definition at line 43 of file typewrapper.hpp.

◆ TypeWrapper() [5/5]

template<typename T , TypeIndex typeIndex>
opcua::TypeWrapper< T, typeIndex >::TypeWrapper ( TypeWrapper< T, typeIndex > && other)
inlineconstexprnoexcept

Move constructor.

Definition at line 47 of file typewrapper.hpp.

Member Function Documentation

◆ operator=() [1/4]

template<typename T , TypeIndex typeIndex>
TypeWrapper & opcua::TypeWrapper< T, typeIndex >::operator= ( const TypeWrapper< T, typeIndex > & other)
inlineconstexpr

Copy assignment (deep copy).

Definition at line 51 of file typewrapper.hpp.

◆ operator=() [2/4]

template<typename T , TypeIndex typeIndex>
TypeWrapper & opcua::TypeWrapper< T, typeIndex >::operator= ( const T & native)
inlineconstexpr

Copy assignment with native object (deep copy).

Definition at line 60 of file typewrapper.hpp.

◆ operator=() [3/4]

template<typename T , TypeIndex typeIndex>
TypeWrapper & opcua::TypeWrapper< T, typeIndex >::operator= ( TypeWrapper< T, typeIndex > && other)
inlineconstexprnoexcept

Move assignment.

Definition at line 69 of file typewrapper.hpp.

◆ operator=() [4/4]

template<typename T , TypeIndex typeIndex>
TypeWrapper & opcua::TypeWrapper< T, typeIndex >::operator= ( T && native)
inlineconstexprnoexcept

Move assignment with native object.

Definition at line 78 of file typewrapper.hpp.

◆ swap() [1/2]

template<typename T , TypeIndex typeIndex>
void opcua::TypeWrapper< T, typeIndex >::swap ( TypeWrapper< T, typeIndex > & other)
inlineconstexprnoexcept

Swap with wrapper object.

Definition at line 87 of file typewrapper.hpp.

◆ swap() [2/2]

template<typename T , TypeIndex typeIndex>
void opcua::TypeWrapper< T, typeIndex >::swap ( T & native)
inlineconstexprnoexcept

Swap with native object.

Definition at line 93 of file typewrapper.hpp.

◆ getTypeIndex()

template<typename T , TypeIndex typeIndex>
static constexpr TypeIndex opcua::TypeWrapper< T, typeIndex >::getTypeIndex ( )
inlinestaticconstexpr

Get type as type index of the UA_TYPES array.

Definition at line 99 of file typewrapper.hpp.

◆ clear()