open62541pp 0.19.0
C++ wrapper of open62541
|
#include <types.hpp>
UA_ExtensionObject wrapper class.
ExtensionObjects may contain scalars of any data type. Even those that are unknown to the receiver. If the received data type is unknown, the encoded string and target NodeId is stored instead of the decoded data.
Public Member Functions | |
template<typename T > | |
ExtensionObject (T *ptr) noexcept | |
template<typename T > | |
ExtensionObject (T *ptr, const UA_DataType &type) noexcept | |
template<typename T , typename = std::enable_if_t<!isExtensionObject<T>>> | |
ExtensionObject (const T &decoded) | |
template<typename T , typename = std::enable_if_t<!isExtensionObject<T>>> | |
ExtensionObject (const T &decoded, const UA_DataType &type) | |
bool | empty () const noexcept |
bool | isEncoded () const noexcept |
bool | isDecoded () const noexcept |
ExtensionObjectEncoding | encoding () const noexcept |
const NodeId * | encodedTypeId () const noexcept |
const ByteString * | encodedBinary () const noexcept |
const XmlElement * | encodedXml () const noexcept |
const UA_DataType * | decodedType () const noexcept |
template<typename T > | |
T * | decodedData () noexcept |
template<typename T > | |
const T * | decodedData () const noexcept |
void * | decodedData () noexcept |
const void * | decodedData () const noexcept |
constexpr | Wrapper () noexcept=default |
constexpr | Wrapper (const Wrapper &other) |
constexpr | Wrapper (const T &native) |
constexpr | Wrapper (Wrapper &&other) noexcept |
constexpr | Wrapper (T &&native) noexcept |
![]() | |
constexpr | Wrapper () noexcept=default |
constexpr | Wrapper (const Wrapper &other) |
constexpr | Wrapper (const T &native) |
constexpr | Wrapper (Wrapper &&other) noexcept |
constexpr | Wrapper (T &&native) noexcept |
~Wrapper () noexcept=default | |
constexpr Wrapper & | operator= (const Wrapper &other) |
constexpr Wrapper & | operator= (const T &native) |
constexpr Wrapper & | operator= (Wrapper &&other) noexcept |
constexpr Wrapper & | operator= (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 |
Additional Inherited Members | |
![]() | |
using | NativeType = T |
using | HandlerType = Handler |
![]() | |
constexpr const T & | native () const noexcept |
constexpr T & | native () noexcept |
constexpr void | clear () noexcept |
![]() | |
template<typename T > | |
constexpr T * | asWrapper (typename T::NativeType *native) noexcept |
template<typename T > | |
constexpr const T * | asWrapper (const typename T::NativeType *native) noexcept |
template<typename T > | |
constexpr T & | asWrapper (typename T::NativeType &native) noexcept |
template<typename T > | |
constexpr const T & | asWrapper (const typename T::NativeType &native) noexcept |
template<typename T > | |
constexpr T::NativeType * | asNative (T *wrapper) noexcept |
template<typename T > | |
constexpr const T::NativeType * | asNative (const T *wrapper) noexcept |
template<typename T > | |
constexpr T::NativeType & | asNative (T &wrapper) noexcept |
template<typename T > | |
constexpr const T::NativeType & | asNative (const T &wrapper) noexcept |
|
inlineexplicitnoexcept |
Create ExtensionObject from a pointer to a decoded object (no copy).
The object will not be deleted when the ExtensionObject is destructed.
ptr | Pointer to decoded object (native or wrapper). |
|
inlinenoexcept |
Create ExtensionObject from a pointer to a decoded object with a custom data type (no copy).
The object will not be deleted when the ExtensionObject is destructed.
ptr | Pointer to decoded object (native or wrapper). |
type | Data type of the decoded object. |
|
inlineexplicit |
Create ExtensionObject from a decoded object (copy).
decoded | Decoded object (native or wrapper). |
|
inlineexplicit |
Create ExtensionObject from a decoded object with a custom data type (copy).
decoded | Decoded object (native or wrapper). |
type | Data type of the decoded object. |
|
inlinenoexcept |
Get const pointer to the decoded data with given template type.
Returns nullptr
if the ExtensionObject is either not decoded or the decoded data is not of type T
.
|
inlinenoexcept |
Get pointer to the decoded data.
Returns nullptr
if the ExtensionObject is not decoded.
|
inlinenoexcept |
Get pointer to the decoded data with given template type.
Returns nullptr
if the ExtensionObject is either not decoded or the decoded data is not of type T
.
Definition at line 1858 of file types.hpp.
Referenced by decodedData(), and decodedData().
|
inlinenoexcept |
Get pointer to the decoded data.
Returns nullptr
if the ExtensionObject is not decoded.
|
inlinenoexcept |
Get the decoded data type.
Returns nullptr
if ExtensionObject is not decoded.
|
inlinenoexcept |
Check if the ExtensionObject is empty.
|
inlinenoexcept |
Get the encoded body in binary format.
Returns nullptr
if ExtensionObject is not encoded in binary format.
|
inlinenoexcept |
Get the encoded type id.
Returns nullptr
if ExtensionObject is not encoded.
|
inlinenoexcept |
Get the encoded body in XML format.
Returns nullptr
if ExtensionObject is not encoded in XML format.
|
inlinenoexcept |
Get the encoding.
Definition at line 1818 of file types.hpp.
Referenced by empty(), isDecoded(), and isEncoded().
|
inlinenoexcept |
Check if the ExtensionObject is decoded.
Definition at line 1812 of file types.hpp.
Referenced by decodedData(), decodedData(), and decodedType().
|
inlinenoexcept |
Check if the ExtensionObject is encoded (usually if the data type is unknown).
Definition at line 1806 of file types.hpp.
Referenced by encodedTypeId().
|
constexprdefaultnoexcept |
|
inlineexplicitconstexpr |
Copy constructor with native object.
Definition at line 151 of file wrapper.hpp.
|
inlineconstexpr |
Copy constructor.
Definition at line 147 of file wrapper.hpp.
|
inlineconstexprnoexcept |
Move constructor with native object.
Definition at line 159 of file wrapper.hpp.
|
inlineconstexprnoexcept |
Move constructor.
Definition at line 155 of file wrapper.hpp.