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

#include <types.hpp>

Inheritance diagram for opcua::DataValue:
[legend]

Detailed Description

Public Member Functions

 DataValue (Variant value) noexcept
 
 DataValue (Variant value, std::optional< DateTime > sourceTimestamp, std::optional< DateTime > serverTimestamp, std::optional< uint16_t > sourcePicoseconds, std::optional< uint16_t > serverPicoseconds, std::optional< StatusCode > status) noexcept
 
void setValue (const Variant &value)
 
void setValue (Variant &&value) noexcept
 
void setSourceTimestamp (DateTime sourceTimestamp) noexcept
 
void setServerTimestamp (DateTime serverTimestamp) noexcept
 
void setSourcePicoseconds (uint16_t sourcePicoseconds) noexcept
 
void setServerPicoseconds (uint16_t serverPicoseconds) noexcept
 
void setStatus (StatusCode status) noexcept
 
bool hasValue () const noexcept
 
bool hasSourceTimestamp () const noexcept
 
bool hasServerTimestamp () const noexcept
 
bool hasSourcePicoseconds () const noexcept
 
bool hasServerPicoseconds () const noexcept
 
bool hasStatus () const noexcept
 
Variantvalue () &noexcept
 
const Variantvalue () const &noexcept
 
Variant && value () &&noexcept
 
const Variant && value () const &&noexcept
 
VariantgetValue () &noexcept
 
const VariantgetValue () const &noexcept
 
Variant && getValue () &&noexcept
 
const Variant && getValue () const &&noexcept
 
DateTime sourceTimestamp () const noexcept
 
DateTime getSourceTimestamp () const noexcept
 
DateTime serverTimestamp () const noexcept
 
DateTime getServerTimestamp () const noexcept
 
uint16_t sourcePicoseconds () const noexcept
 
uint16_t getSourcePicoseconds () const noexcept
 
uint16_t serverPicoseconds () const noexcept
 
uint16_t getServerPicoseconds () const noexcept
 
StatusCode status () const noexcept
 
StatusCode getStatus () const noexcept
 
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_DataValue, UA_TYPES_DATAVALUE >
constexpr TypeWrapper () noexcept=default
 
constexpr TypeWrapper (const UA_DataValue &native)
 
constexpr TypeWrapper (UA_DataValue &&native) noexcept
 
constexpr TypeWrapper (const TypeWrapper &other)
 
constexpr TypeWrapper (TypeWrapper &&other) noexcept
 
 ~TypeWrapper ()
 
constexpr TypeWrapperoperator= (const TypeWrapper &other)
 
constexpr TypeWrapperoperator= (const UA_DataValue &native)
 
constexpr TypeWrapperoperator= (TypeWrapper &&other) noexcept
 
constexpr TypeWrapperoperator= (UA_DataValue &&native) noexcept
 
- Public Member Functions inherited from opcua::Wrapper< UA_DataValue >
constexpr Wrapper () noexcept=default
 
constexpr Wrapper (const UA_DataValue &native) noexcept
 
constexpr Wrapper (UA_DataValue &&native) noexcept
 
constexpr Wrapperoperator= (const UA_DataValue &native) noexcept
 
constexpr Wrapperoperator= (UA_DataValue &&native) noexcept
 
constexpr operator UA_DataValue & () noexcept
 
constexpr operator const UA_DataValue & () const noexcept
 
constexpr UA_DataValueoperator-> () noexcept
 
constexpr const UA_DataValueoperator-> () const noexcept
 
constexpr UA_DataValuehandle () noexcept
 
constexpr const UA_DataValuehandle () const noexcept
 
constexpr void swap (Wrapper &other) noexcept
 
constexpr void swap (UA_DataValue &native) noexcept
 

Static Public Member Functions

template<VariantPolicy Policy = VariantPolicy::Copy, typename... Args>
static DataValue fromScalar (Args &&... args)
 
template<VariantPolicy Policy = VariantPolicy::Copy, typename... Args>
static DataValue fromArray (Args &&... args)
 
- Static Public Member Functions inherited from opcua::TypeWrapper< UA_DataValue, UA_TYPES_DATAVALUE >
static constexpr TypeIndex typeIndex ()
 

Additional Inherited Members

- Public Types inherited from opcua::Wrapper< UA_DataValue >
using NativeType
 
- Protected Member Functions inherited from opcua::TypeWrapper< UA_DataValue, UA_TYPES_DATAVALUE >
constexpr void clear () noexcept
 
- Protected Member Functions inherited from opcua::Wrapper< UA_DataValue >
constexpr const UA_DataValuenative () const noexcept
 
constexpr UA_DataValuenative () noexcept
 

Constructor & Destructor Documentation

◆ DataValue() [1/2]

opcua::DataValue::DataValue ( Variant value)
inlineexplicitnoexcept

Definition at line 1836 of file types.hpp.

Referenced by fromArray(), and fromScalar().

◆ DataValue() [2/2]

opcua::DataValue::DataValue ( Variant value,
std::optional< DateTime > sourceTimestamp,
std::optional< DateTime > serverTimestamp,
std::optional< uint16_t > sourcePicoseconds,
std::optional< uint16_t > serverPicoseconds,
std::optional< StatusCode > status )
inlinenoexcept

Definition at line 1840 of file types.hpp.

Member Function Documentation

◆ fromScalar()

template<VariantPolicy Policy = VariantPolicy::Copy, typename... Args>
static DataValue opcua::DataValue::fromScalar ( Args &&... args)
inlinestaticnodiscard

Create DataValue from scalar value.

Deprecated
Use constructor with new universal Variant constructor instead: opcua::DataValue dv(opcua::Variant(value))

Definition at line 1870 of file types.hpp.

◆ fromArray()

template<VariantPolicy Policy = VariantPolicy::Copy, typename... Args>
static DataValue opcua::DataValue::fromArray ( Args &&... args)
inlinestaticnodiscard

Create DataValue from array.

See also
Variant::fromArray
Deprecated
Use constructor with new universal Variant constructor instead: opcua::DataValue dv(opcua::Variant(array))

Definition at line 1880 of file types.hpp.

◆ setValue() [1/2]

void opcua::DataValue::setValue ( const Variant & value)
inline

Set value (copy).

Examples
server_datasource.cpp.

Definition at line 1885 of file types.hpp.

Referenced by DataValue().

◆ setValue() [2/2]

void opcua::DataValue::setValue ( Variant && value)
inlinenoexcept

Set value (move).

Definition at line 1891 of file types.hpp.

◆ setSourceTimestamp()

void opcua::DataValue::setSourceTimestamp ( DateTime sourceTimestamp)
inlinenoexcept

Set source timestamp for the value.

Examples
server_datasource.cpp.

Definition at line 1897 of file types.hpp.

◆ setServerTimestamp()

void opcua::DataValue::setServerTimestamp ( DateTime serverTimestamp)
inlinenoexcept

Set server timestamp for the value.

Definition at line 1903 of file types.hpp.

◆ setSourcePicoseconds()

void opcua::DataValue::setSourcePicoseconds ( uint16_t sourcePicoseconds)
inlinenoexcept

Set picoseconds interval added to the source timestamp.

Definition at line 1909 of file types.hpp.

◆ setServerPicoseconds()

void opcua::DataValue::setServerPicoseconds ( uint16_t serverPicoseconds)
inlinenoexcept

Set picoseconds interval added to the server timestamp.

Definition at line 1915 of file types.hpp.

◆ setStatus()

void opcua::DataValue::setStatus ( StatusCode status)
inlinenoexcept

Set status.

Definition at line 1921 of file types.hpp.

◆ hasValue()

bool opcua::DataValue::hasValue ( ) const
inlinenoexcept

Definition at line 1926 of file types.hpp.

◆ hasSourceTimestamp()

bool opcua::DataValue::hasSourceTimestamp ( ) const
inlinenoexcept

Definition at line 1930 of file types.hpp.

◆ hasServerTimestamp()

bool opcua::DataValue::hasServerTimestamp ( ) const
inlinenoexcept

Definition at line 1934 of file types.hpp.

◆ hasSourcePicoseconds()

bool opcua::DataValue::hasSourcePicoseconds ( ) const
inlinenoexcept

Definition at line 1938 of file types.hpp.

◆ hasServerPicoseconds()

bool opcua::DataValue::hasServerPicoseconds ( ) const
inlinenoexcept

Definition at line 1942 of file types.hpp.

◆ hasStatus()

bool opcua::DataValue::hasStatus ( ) const
inlinenoexcept

Definition at line 1946 of file types.hpp.

◆ value() [1/4]

◆ value() [2/4]

const Variant & opcua::DataValue::value ( ) const &
inlinenoexcept

Get value.

Definition at line 1956 of file types.hpp.

◆ value() [3/4]

Variant && opcua::DataValue::value ( ) &&
inlinenoexcept

Get value (rvalue).

Definition at line 1961 of file types.hpp.

◆ value() [4/4]

const Variant && opcua::DataValue::value ( ) const &&
inlinenoexcept

Get value (rvalue).

Definition at line 1966 of file types.hpp.

◆ getValue() [1/4]

Variant & opcua::DataValue::getValue ( ) &
inlinenoexcept
Deprecated
Use value() instead

Definition at line 1972 of file types.hpp.

◆ getValue() [2/4]

const Variant & opcua::DataValue::getValue ( ) const &
inlinenoexcept
Deprecated
Use value() instead

Definition at line 1978 of file types.hpp.

◆ getValue() [3/4]

Variant && opcua::DataValue::getValue ( ) &&
inlinenoexcept
Deprecated
Use value() instead

Definition at line 1984 of file types.hpp.

◆ getValue() [4/4]

const Variant && opcua::DataValue::getValue ( ) const &&
inlinenoexcept
Deprecated
Use value() instead

Definition at line 1990 of file types.hpp.

◆ sourceTimestamp()

DateTime opcua::DataValue::sourceTimestamp ( ) const
inlinenoexcept

Get source timestamp for the value.

Definition at line 1995 of file types.hpp.

Referenced by DataValue(), getSourceTimestamp(), setSourceTimestamp(), and sourceTimestamp().

◆ getSourceTimestamp()

DateTime opcua::DataValue::getSourceTimestamp ( ) const
inlinenoexcept
Deprecated
Use sourceTimestamp() instead

Definition at line 2001 of file types.hpp.

◆ serverTimestamp()

DateTime opcua::DataValue::serverTimestamp ( ) const
inlinenoexcept

Get server timestamp for the value.

Definition at line 2006 of file types.hpp.

Referenced by DataValue(), getServerTimestamp(), serverTimestamp(), and setServerTimestamp().

◆ getServerTimestamp()

DateTime opcua::DataValue::getServerTimestamp ( ) const
inlinenoexcept
Deprecated
Use serverTimestamp() instead

Definition at line 2012 of file types.hpp.

◆ sourcePicoseconds()

uint16_t opcua::DataValue::sourcePicoseconds ( ) const
inlinenoexcept

Get picoseconds interval added to the source timestamp.

Definition at line 2017 of file types.hpp.

Referenced by DataValue(), getSourcePicoseconds(), and setSourcePicoseconds().

◆ getSourcePicoseconds()

uint16_t opcua::DataValue::getSourcePicoseconds ( ) const
inlinenoexcept
Deprecated
Use sourcePicoseconds() instead

Definition at line 2023 of file types.hpp.

◆ serverPicoseconds()

uint16_t opcua::DataValue::serverPicoseconds ( ) const
inlinenoexcept

Get picoseconds interval added to the server timestamp.

Definition at line 2028 of file types.hpp.

Referenced by DataValue(), getServerPicoseconds(), and setServerPicoseconds().

◆ getServerPicoseconds()

uint16_t opcua::DataValue::getServerPicoseconds ( ) const
inlinenoexcept
Deprecated
Use serverPicoseconds() instead

Definition at line 2034 of file types.hpp.

◆ status()

StatusCode opcua::DataValue::status ( ) const
inlinenoexcept

Get status.

Definition at line 2039 of file types.hpp.

Referenced by getStatus(), and setStatus().

◆ getStatus()

StatusCode opcua::DataValue::getStatus ( ) const
inlinenoexcept
Deprecated
Use status() instead

Definition at line 2045 of file types.hpp.

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