open62541pp 0.16.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
 
bool hasValue () const noexcept
 
bool hasSourceTimestamp () const noexcept
 
bool hasServerTimestamp () const noexcept
 
bool hasSourcePicoseconds () const noexcept
 
bool hasServerPicoseconds () const noexcept
 
bool hasStatus () const noexcept
 
VariantgetValue () &noexcept
 
const VariantgetValue () const &noexcept
 
Variant && getValue () &&noexcept
 
const Variant && getValue () const &&noexcept
 
DateTime getSourceTimestamp () const noexcept
 
DateTime getServerTimestamp () const noexcept
 
uint16_t getSourcePicoseconds () const noexcept
 
uint16_t getServerPicoseconds () const noexcept
 
StatusCode getStatus () const 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
 
constexpr TypeWrapper ()=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 ()=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
 
constexpr void swap (TypeWrapper &other) noexcept
 
constexpr void swap (UA_DataValue &native) noexcept
 
- Public Member Functions inherited from opcua::Wrapper< UA_DataValue >
constexpr Wrapper ()=default
 
constexpr Wrapper (const UA_DataValue &native)
 
constexpr Wrapper (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
 

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 getTypeIndex ()
 

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 1482 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 1486 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.

See also
Variant::fromScalar

Definition at line 1514 of file types.hpp.

Referenced by opcua::services::detail::AttributeHandlerScalar< T, Enable >::toDataValue().

◆ fromArray()

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

◆ hasValue()

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

◆ hasSourceTimestamp()

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

Definition at line 1529 of file types.hpp.

◆ hasServerTimestamp()

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

Definition at line 1533 of file types.hpp.

◆ hasSourcePicoseconds()

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

Definition at line 1537 of file types.hpp.

◆ hasServerPicoseconds()

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

Definition at line 1541 of file types.hpp.

◆ hasStatus()

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

Definition at line 1545 of file types.hpp.

◆ getValue() [1/4]

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

Get value.

Examples
client_subscription.cpp, and server_datasource.cpp.

Definition at line 1550 of file types.hpp.

◆ getValue() [2/4]

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

Get value.

Definition at line 1555 of file types.hpp.

◆ getValue() [3/4]

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

Get value (rvalue).

Definition at line 1560 of file types.hpp.

◆ getValue() [4/4]

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

Get value (rvalue).

Definition at line 1565 of file types.hpp.

◆ getSourceTimestamp()

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

Get source timestamp for the value.

Definition at line 1570 of file types.hpp.

◆ getServerTimestamp()

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

Get server timestamp for the value.

Definition at line 1575 of file types.hpp.

◆ getSourcePicoseconds()

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

Get picoseconds interval added to the source timestamp.

Definition at line 1580 of file types.hpp.

◆ getServerPicoseconds()

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

Get picoseconds interval added to the server timestamp.

Definition at line 1585 of file types.hpp.

◆ getStatus()

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

Get status.

Definition at line 1590 of file types.hpp.

◆ setValue() [1/2]

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

Set value (copy).

Definition at line 1595 of file types.hpp.

Referenced by DataValue().

◆ setValue() [2/2]

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

Set value (move).

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

◆ setServerTimestamp()

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

Set server timestamp for the value.

Definition at line 1613 of file types.hpp.

◆ setSourcePicoseconds()

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

Set picoseconds interval added to the source timestamp.

Definition at line 1619 of file types.hpp.

◆ setServerPicoseconds()

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

Set picoseconds interval added to the server timestamp.

Definition at line 1625 of file types.hpp.

◆ setStatus()

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

Set status.

Definition at line 1631 of file types.hpp.

◆ TypeWrapper() [1/5]

opcua::TypeWrapper< T, typeIndex >::TypeWrapper ( )
constexprdefault

◆ TypeWrapper() [2/5]

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]

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

Constructor with native object (move rvalue).

Definition at line 35 of file typewrapper.hpp.

◆ TypeWrapper() [4/5]

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

Copy constructor (deep copy).

Definition at line 43 of file typewrapper.hpp.

◆ TypeWrapper() [5/5]

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

Move constructor.

Definition at line 47 of file typewrapper.hpp.