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

#include <types.hpp>

Inheritance diagram for opcua::DataValue:
[legend]

Detailed Description

UA_DataValue wrapper class.

See also
https://reference.opcfoundation.org/Core/Part4/v105/docs/7.11
Examples
client_async.cpp, client_subscription.cpp, server_datasource.cpp, and server_valuecallback.cpp.

Definition at line 1849 of file types.hpp.

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

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< T >
using NativeType = T
 
- Protected Member Functions inherited from opcua::TypeWrapper< UA_DataValue, UA_TYPES_DATAVALUE >
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

◆ DataValue() [1/2]

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

Definition at line 1853 of file types.hpp.

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

Member Function Documentation

◆ fromScalar()

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

Create DataValue from scalar value.

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

Definition at line 1887 of file types.hpp.

◆ fromArray()

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

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

Referenced by DataValue().

◆ setValue() [2/2]

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

Set value (move).

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

◆ setServerTimestamp()

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

Set server timestamp for the value.

Definition at line 1920 of file types.hpp.

◆ setSourcePicoseconds()

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

Set picoseconds interval added to the source timestamp.

Definition at line 1926 of file types.hpp.

◆ setServerPicoseconds()

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

Set picoseconds interval added to the server timestamp.

Definition at line 1932 of file types.hpp.

◆ setStatus()

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

Set status.

Definition at line 1938 of file types.hpp.

◆ hasValue()

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

Definition at line 1943 of file types.hpp.

◆ hasSourceTimestamp()

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

Definition at line 1947 of file types.hpp.

◆ hasServerTimestamp()

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

Definition at line 1951 of file types.hpp.

◆ hasSourcePicoseconds()

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

Definition at line 1955 of file types.hpp.

◆ hasServerPicoseconds()

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

Definition at line 1959 of file types.hpp.

◆ hasStatus()

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

Definition at line 1963 of file types.hpp.

◆ value() [1/4]

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

◆ value() [2/4]

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

Get value.

Definition at line 1973 of file types.hpp.

◆ value() [3/4]

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

Get value (rvalue).

Definition at line 1978 of file types.hpp.

◆ value() [4/4]

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

Get value (rvalue).

Definition at line 1983 of file types.hpp.

◆ getValue() [1/4]

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

Definition at line 1989 of file types.hpp.

◆ getValue() [2/4]

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

Definition at line 1995 of file types.hpp.

◆ getValue() [3/4]

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

Definition at line 2001 of file types.hpp.

◆ getValue() [4/4]

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

Definition at line 2007 of file types.hpp.

◆ sourceTimestamp()

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

Get source timestamp for the value.

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

◆ serverTimestamp()

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

Get server timestamp for the value.

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

◆ sourcePicoseconds()

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

Get picoseconds interval added to the source timestamp.

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

◆ serverPicoseconds()

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

Get picoseconds interval added to the server timestamp.

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

◆ status()

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

Get status.

Definition at line 2056 of file types.hpp.

Referenced by getStatus(), and setStatus().

◆ getStatus()

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

Definition at line 2062 of file types.hpp.

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