open62541pp 0.16.0
C++ wrapper of open62541
|
#include <types.hpp>
UA_DateTime wrapper class.
An instance in time. A DateTime value is encoded as a 64-bit signed integer which represents the number of 100 nanosecond intervals since January 1, 1601 (UTC).
Public Types | |
using | DefaultClock = std::chrono::system_clock |
using | UaDuration = std::chrono::duration<int64_t, std::ratio<1, 10'000'000>> |
Public Types inherited from opcua::Wrapper< UA_DateTime > | |
using | NativeType |
Public Member Functions | |
template<typename Clock , typename Duration > | |
DateTime (std::chrono::time_point< Clock, Duration > timePoint) | |
template<typename Clock = DefaultClock, typename Duration = UaDuration> | |
std::chrono::time_point< Clock, Duration > | toTimePoint () const |
int64_t | toUnixTime () const noexcept |
UA_DateTimeStruct | toStruct () const noexcept |
int64_t | get () const noexcept |
std::string | format (std::string_view format, bool localtime=false) const |
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_DateTime, UA_TYPES_DATETIME > | |
constexpr | TypeWrapper ()=default |
constexpr | TypeWrapper (const UA_DateTime &native) |
constexpr | TypeWrapper (UA_DateTime &&native) noexcept |
constexpr | TypeWrapper (const TypeWrapper &other) |
constexpr | TypeWrapper (TypeWrapper &&other) noexcept |
~TypeWrapper () | |
constexpr TypeWrapper & | operator= (const TypeWrapper &other) |
constexpr TypeWrapper & | operator= (const UA_DateTime &native) |
constexpr TypeWrapper & | operator= (TypeWrapper &&other) noexcept |
constexpr TypeWrapper & | operator= (UA_DateTime &&native) noexcept |
constexpr void | swap (TypeWrapper &other) noexcept |
constexpr void | swap (UA_DateTime &native) noexcept |
Public Member Functions inherited from opcua::Wrapper< UA_DateTime > | |
constexpr | Wrapper ()=default |
constexpr | Wrapper (const UA_DateTime &native) |
constexpr | Wrapper (UA_DateTime &&native) noexcept |
constexpr | operator UA_DateTime & () noexcept |
constexpr | operator const UA_DateTime & () const noexcept |
constexpr UA_DateTime * | operator-> () noexcept |
constexpr const UA_DateTime * | operator-> () const noexcept |
constexpr UA_DateTime * | handle () noexcept |
constexpr const UA_DateTime * | handle () const noexcept |
Static Public Member Functions | |
static DateTime | now () noexcept |
template<typename Clock , typename Duration > | |
static DateTime | fromTimePoint (std::chrono::time_point< Clock, Duration > timePoint) |
static DateTime | fromUnixTime (int64_t unixTime) noexcept |
static int64_t | localTimeUtcOffset () noexcept |
Static Public Member Functions inherited from opcua::TypeWrapper< UA_DateTime, UA_TYPES_DATETIME > | |
static constexpr TypeIndex | getTypeIndex () |
Additional Inherited Members | |
Protected Member Functions inherited from opcua::TypeWrapper< UA_DateTime, UA_TYPES_DATETIME > | |
constexpr void | clear () noexcept |
Protected Member Functions inherited from opcua::Wrapper< UA_DateTime > | |
constexpr const UA_DateTime & | native () const noexcept |
constexpr UA_DateTime & | native () noexcept |
using opcua::DateTime::DefaultClock = std::chrono::system_clock |
using opcua::DateTime::UaDuration = std::chrono::duration<int64_t, std::ratio<1, 10'000'000>> |
|
inlinestatic |
Get DateTime from std::chrono::time_point.
Definition at line 372 of file types.hpp.
Referenced by opcua::TypeConverter< std::chrono::time_point< Clock, Duration > >::toNative().
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inline |
Convert to std::chrono::time_point.
Definition at line 391 of file types.hpp.
Referenced by opcua::TypeConverter< std::chrono::time_point< Clock, Duration > >::fromNative().
|
inlinenoexcept |
|
inlinenoexcept |
Convert to UA_DateTimeStruct.
|
inlinenoexcept |
Get DateTime value as 100 nanosecond intervals since January 1, 1601 (UTC).
Definition at line 414 of file types.hpp.
Referenced by toStruct(), toTimePoint(), and toUnixTime().
std::string opcua::DateTime::format | ( | std::string_view | format, |
bool | localtime = false ) const |
Convert to string with given format (same format codes as strftime).
|
constexprdefault |
|
inlineexplicitconstexpr |
Constructor with native object (deep copy).
Definition at line 31 of file typewrapper.hpp.
|
inlineconstexprnoexcept |
Constructor with native object (move rvalue).
Definition at line 35 of file typewrapper.hpp.
|
inlineconstexpr |
Copy constructor (deep copy).
Definition at line 43 of file typewrapper.hpp.
|
inlineconstexprnoexcept |
Move constructor.
Definition at line 47 of file typewrapper.hpp.