open62541pp 0.16.0
C++ wrapper of open62541
Loading...
Searching...
No Matches
opcua::detail Namespace Reference

Classes

struct  AlwaysFalse
 
struct  ClientContext
 
class  ContextMap
 
class  ExceptionCatcher
 
struct  IsContiguousContainer
 
struct  IsContiguousContainer< T, std::void_t< decltype(std::declval< T >().data()), decltype(std::declval< T >().size()), decltype(std::declval< T >().begin()), decltype(std::declval< T >().end())> >
 
struct  IsConvertibleType
 
struct  IsConvertibleType< T, std::void_t< decltype(TypeConverter< T >{})> >
 
struct  IsMutableContainer
 
struct  IsNodeIdEnum
 
struct  IsNodeIdEnum< T, std::void_t< decltype(getNamespace(std::declval< T >()))> >
 
struct  IsRegisteredType
 
struct  IsRegisteredType< T, std::void_t< decltype(TypeRegistry< T >{})> >
 
struct  IsSpan
 
struct  IsSpan< Span< T > >
 
struct  IsStaleable
 
struct  IsStaleable< T, std::void_t< decltype(std::declval< T >().stale)> >
 
struct  IsTypeWrapper
 
struct  IsWrapper
 
struct  MemberType
 
struct  MemberType< T C::* >
 
struct  NodeContext
 
struct  Overload
 
struct  ResultType
 
struct  ResultType< BadResult >
 
struct  ResultType< StatusCode >
 
class  ScopeExit
 
struct  ServerContext
 
struct  SessionRegistry
 
class  StringWrapper
 
struct  VariantHandler
 
struct  VariantHandler< VariantPolicy::Copy >
 
struct  VariantHandler< VariantPolicy::Reference >
 
struct  VariantHandler< VariantPolicy::ReferenceIfPossible >
 
struct  WrapperConversion
 

Typedefs

template<typename T , typename... Ts>
using IsOneOf = std::disjunction<std::is_same<T, Ts>...>
 
template<typename T >
using MemberTypeT = typename MemberType<T>::type
 
template<typename T , typename U >
using EnableIfEqualityComparable
 

Enumerations

enum class  ClientState
 

Functions

UA_DataTypeMember createDataTypeMember (const char *memberName, const UA_DataType &memberType, uint8_t padding, bool isArray, bool isOptional) noexcept
 
UA_DataType createDataType (const char *typeName, UA_NodeId typeId, UA_NodeId binaryEncodingId, uint16_t memSize, uint8_t typeKind, bool pointerFree, bool overlayable, uint32_t membersSize, DataTypeMember *members) noexcept
 
UA_DataTypeArray createDataTypeArray (Span< const DataType > types, const UA_DataTypeArray *next=nullptr) noexcept
 
template<auto memberPtr>
const UA_DataTypegetMemberDataType ()
 
template<typename T , typename TMember >
size_t offsetOfMember (TMember T::*member)
 
UA_ClientConfiggetConfig (UA_Client *client) noexcept
 
UA_LoggergetLogger (UA_ClientConfig *config) noexcept
 
ClientContextgetContext (UA_Client *client) noexcept
 
ClientContextgetContext (Client &client) noexcept
 
ExceptionCatchergetExceptionCatcher (UA_Client *client) noexcept
 
ExceptionCatchergetExceptionCatcher (Client &client) noexcept
 
UA_ClientgetHandle (Client &client) noexcept
 
template<typename F , typename... Args>
auto tryInvoke (F &&func, Args &&... args) noexcept -> typename ResultType< std::invoke_result_t< F, Args... > >::Type
 
UA_ServerConfiggetConfig (UA_Server *server) noexcept
 
UA_LoggergetLogger (UA_ServerConfig *config) noexcept
 
ServerContextgetContext (UA_Server *server) noexcept
 
ServerContextgetContext (Server &server) noexcept
 
ExceptionCatchergetExceptionCatcher (UA_Server *server) noexcept
 
ExceptionCatchergetExceptionCatcher (Server &server) noexcept
 
UA_ServergetHandle (Server &server) noexcept
 
UA_String toNativeString (std::string_view src) noexcept
 
UA_String allocNativeString (std::string_view src)
 
std::string_view toStringView (const UA_String &src) noexcept
 
std::string toString (const UA_String &src)
 
std::string toString (const char *format, va_list args)
 
std::string toString (const char *format,...)
 
template<typename... Ts>
 Overload (Ts...) -> Overload< Ts... >
 
template<typename T , typename = std::enable_if_t<std::is_enum_v<T>>>
auto toNative (T value) noexcept
 
auto toNative (std::string_view value)
 
template<typename T , typename = std::enable_if_t<isWrapper<T>>>
auto toNative (T &&value)
 
template<typename T >
auto * toNativeArray (Span< const T > array)
 
template<typename T >
constexpr bool isBorrowed (const T &) noexcept
 
constexpr bool isBorrowed (const UA_Variant &native) noexcept
 
constexpr bool isBorrowed (const UA_DataValue &native) noexcept
 
constexpr bool isBorrowed (const UA_ExtensionObject &native) noexcept
 
template<typename T >
constexpr bool isValidTypeCombination (const UA_DataType &type)
 
template<typename T >
constexpr void clear (T &native, const UA_DataType &type) noexcept
 
template<typename T >
void deallocate (T *native, const UA_DataType &type) noexcept
 
template<typename T >
T * allocate (const UA_DataType &type)
 
template<typename T >
auto allocateUniquePtr (const UA_DataType &type)
 
template<typename T >
constexpr T copy (const T &src, const UA_DataType &type) noexcept(isPointerFree< T >)
 
template<typename T >
void deallocateArray (T *array, size_t size, const UA_DataType &type) noexcept
 
template<typename T >
T * allocateArray (size_t size, const UA_DataType &type)
 
template<typename T >
auto allocateArrayUniquePtr (size_t size, const UA_DataType &type)
 
template<typename T >
T * copyArray (const T *src, size_t size, const UA_DataType &type)
 
template<typename T >
void resizeArray (T *&array, size_t &size, size_t newSize, const UA_DataType &type)
 
constexpr bool isGood (UA_StatusCode code) noexcept
 
constexpr bool isUncertain (UA_StatusCode code) noexcept
 
constexpr bool isBad (UA_StatusCode code) noexcept
 
UA_StatusCode getStatusCode (std::exception_ptr eptr) noexcept
 
void clear (UA_AccessControl &ac) noexcept
 
void clear (UA_Logger &logger) noexcept
 

Variables

constexpr size_t clientStateCount = 4
 
template<typename T >
constexpr bool isPointerFree
 
template<typename T >
constexpr bool isConvertibleType = IsConvertibleType<T>::value
 
template<typename T >
constexpr bool isRegisteredType = IsRegisteredType<T>::value
 
template<typename T >
constexpr bool isTypeWrapper = IsTypeWrapper<T>::value
 
template<typename T >
constexpr bool isWrapper = IsWrapper<T>::value
 

Typedef Documentation

◆ IsOneOf

template<typename T , typename... Ts>
using opcua::detail::IsOneOf = std::disjunction<std::is_same<T, Ts>...>

Definition at line 19 of file traits.hpp.

◆ MemberTypeT

template<typename T >
using opcua::detail::MemberTypeT = typename MemberType<T>::type

Definition at line 31 of file traits.hpp.

◆ EnableIfEqualityComparable

template<typename T , typename U >
using opcua::detail::EnableIfEqualityComparable
Initial value:
typename std::enable_if_t<
std::is_invocable_v<std::equal_to<>, const T&, const U&> &&
std::is_invocable_v<std::not_equal_to<>, const T&, const U&>>

Definition at line 219 of file span.hpp.

Enumeration Type Documentation

◆ ClientState

enum class opcua::detail::ClientState
strong
Enumerator
Disconnected 
Connected 
SessionActivated 
SessionClosed 

Definition at line 21 of file client_context.hpp.

Function Documentation

◆ createDataTypeMember()

UA_DataTypeMember opcua::detail::createDataTypeMember ( const char * memberName,
const UA_DataType & memberType,
uint8_t padding,
bool isArray,
bool isOptional )
nodiscardnoexcept

◆ createDataType()

UA_DataType opcua::detail::createDataType ( const char * typeName,
UA_NodeId typeId,
UA_NodeId binaryEncodingId,
uint16_t memSize,
uint8_t typeKind,
bool pointerFree,
bool overlayable,
uint32_t membersSize,
DataTypeMember * members )
nodiscardnoexcept

◆ createDataTypeArray()

UA_DataTypeArray opcua::detail::createDataTypeArray ( Span< const DataType > types,
const UA_DataTypeArray * next = nullptr )
nodiscardnoexcept

◆ getMemberDataType()

template<auto memberPtr>
const UA_DataType & opcua::detail::getMemberDataType ( )

Definition at line 178 of file datatype.hpp.

◆ offsetOfMember()

template<typename T , typename TMember >
size_t opcua::detail::offsetOfMember ( TMember T::* member)

◆ getConfig() [1/2]

UA_ClientConfig * opcua::detail::getConfig ( UA_Client * client)
noexcept

◆ getLogger() [1/2]

UA_Logger * opcua::detail::getLogger ( UA_ClientConfig * config)
noexcept

◆ getContext() [1/4]

ClientContext * opcua::detail::getContext ( UA_Client * client)
noexcept

◆ getContext() [2/4]

ClientContext & opcua::detail::getContext ( Client & client)
noexcept

◆ getExceptionCatcher() [1/4]

ExceptionCatcher * opcua::detail::getExceptionCatcher ( UA_Client * client)
noexcept

◆ getExceptionCatcher() [2/4]

ExceptionCatcher & opcua::detail::getExceptionCatcher ( Client & client)
noexcept

◆ getHandle() [1/2]

◆ tryInvoke()

template<typename F , typename... Args>
auto opcua::detail::tryInvoke ( F && func,
Args &&... args ) -> typename ResultType<std::invoke_result_t<F, Args...>>::Type
noexcept

Invoke a function and capture its Result (value or status code).

This is especially useful for C-API callbacks, that are executed within the open62541 event loop.

Definition at line 31 of file result_utils.hpp.

◆ getConfig() [2/2]

UA_ServerConfig * opcua::detail::getConfig ( UA_Server * server)
noexcept

◆ getLogger() [2/2]

UA_Logger * opcua::detail::getLogger ( UA_ServerConfig * config)
noexcept

◆ getContext() [3/4]

ServerContext * opcua::detail::getContext ( UA_Server * server)
noexcept

◆ getContext() [4/4]

ServerContext & opcua::detail::getContext ( Server & server)
noexcept

◆ getExceptionCatcher() [3/4]

ExceptionCatcher * opcua::detail::getExceptionCatcher ( UA_Server * server)
noexcept

◆ getExceptionCatcher() [4/4]

ExceptionCatcher & opcua::detail::getExceptionCatcher ( Server & server)
noexcept

◆ getHandle() [2/2]

UA_Server * opcua::detail::getHandle ( Server & server)
noexcept

◆ toNativeString()

UA_String opcua::detail::toNativeString ( std::string_view src)
noexcept

Convert std::string_view to UA_String (no copy)

Referenced by opcua::services::detail::createAddNodesItem().

◆ allocNativeString()

UA_String opcua::detail::allocNativeString ( std::string_view src)
nodiscard

◆ toStringView()

std::string_view opcua::detail::toStringView ( const UA_String & src)
inlinenoexcept

◆ toString() [1/3]

std::string opcua::detail::toString ( const UA_String & src)
inline

Convert UA_String to std::string.

Definition at line 27 of file string_utils.hpp.

Referenced by toString().

◆ toString() [2/3]

std::string opcua::detail::toString ( const char * format,
va_list args )

Convert format string with args to std::string.

◆ toString() [3/3]

std::string opcua::detail::toString ( const char * format,
... )
inline

Definition at line 35 of file string_utils.hpp.

◆ Overload()

template<typename... Ts>
opcua::detail::Overload ( Ts... ) -> Overload< Ts... >

◆ toNative() [1/3]

template<typename T , typename = std::enable_if_t<std::is_enum_v<T>>>
auto opcua::detail::toNative ( T value)
nodiscardnoexcept

◆ toNative() [2/3]

auto opcua::detail::toNative ( std::string_view value)
inlinenodiscard

Definition at line 19 of file types_conversion.hpp.

◆ toNative() [3/3]

template<typename T , typename = std::enable_if_t<isWrapper<T>>>
auto opcua::detail::toNative ( T && value)
nodiscard

Definition at line 24 of file types_conversion.hpp.

◆ toNativeArray()

template<typename T >
auto * opcua::detail::toNativeArray ( Span< const T > array)
nodiscard

Definition at line 32 of file types_conversion.hpp.

◆ isBorrowed() [1/4]

template<typename T >
bool opcua::detail::isBorrowed ( const T & )
constexprnoexcept

Definition at line 36 of file types_handling.hpp.

Referenced by clear().

◆ isBorrowed() [2/4]

bool opcua::detail::isBorrowed ( const UA_Variant & native)
constexprnoexcept

Definition at line 40 of file types_handling.hpp.

◆ isBorrowed() [3/4]

bool opcua::detail::isBorrowed ( const UA_DataValue & native)
constexprnoexcept

Definition at line 44 of file types_handling.hpp.

◆ isBorrowed() [4/4]

bool opcua::detail::isBorrowed ( const UA_ExtensionObject & native)
constexprnoexcept

Definition at line 48 of file types_handling.hpp.

◆ isValidTypeCombination()

template<typename T >
bool opcua::detail::isValidTypeCombination ( const UA_DataType & type)
constexpr

Definition at line 53 of file types_handling.hpp.

Referenced by allocate(), allocateArray(), clear(), copy(), deallocate(), and deallocateArray().

◆ clear() [1/3]

template<typename T >
void opcua::detail::clear ( T & native,
const UA_DataType & type )
constexprnoexcept

Definition at line 62 of file types_handling.hpp.

Referenced by opcua::TypeWrapper< T, typeIndex >::clear().

◆ deallocate()

template<typename T >
void opcua::detail::deallocate ( T * native,
const UA_DataType & type )
noexcept

Definition at line 75 of file types_handling.hpp.

Referenced by allocateUniquePtr().

◆ allocate()

template<typename T >
T * opcua::detail::allocate ( const UA_DataType & type)
nodiscard

◆ allocateUniquePtr()

template<typename T >
auto opcua::detail::allocateUniquePtr ( const UA_DataType & type)
nodiscard

Definition at line 91 of file types_handling.hpp.

◆ copy()

template<typename T >
T opcua::detail::copy ( const T & src,
const UA_DataType & type )
nodiscardconstexprnoexcept

◆ deallocateArray()

template<typename T >
void opcua::detail::deallocateArray ( T * array,
size_t size,
const UA_DataType & type )
noexcept

Definition at line 111 of file types_handling.hpp.

Referenced by allocateArrayUniquePtr(), and resizeArray().

◆ allocateArray()

template<typename T >
T * opcua::detail::allocateArray ( size_t size,
const UA_DataType & type )
nodiscard

Definition at line 117 of file types_handling.hpp.

Referenced by allocateArrayUniquePtr(), copyArray(), and resizeArray().

◆ allocateArrayUniquePtr()

template<typename T >
auto opcua::detail::allocateArrayUniquePtr ( size_t size,
const UA_DataType & type )
nodiscard

Definition at line 127 of file types_handling.hpp.

◆ copyArray()

template<typename T >
T * opcua::detail::copyArray ( const T * src,
size_t size,
const UA_DataType & type )
nodiscard

Definition at line 133 of file types_handling.hpp.

Referenced by toNativeArray().

◆ resizeArray()

template<typename T >
void opcua::detail::resizeArray ( T *& array,
size_t & size,
size_t newSize,
const UA_DataType & type )

Definition at line 145 of file types_handling.hpp.

◆ isGood()

bool opcua::detail::isGood ( UA_StatusCode code)
nodiscardconstexprnoexcept

Definition at line 54 of file exception.hpp.

Referenced by opcua::StatusCode::isGood().

◆ isUncertain()

bool opcua::detail::isUncertain ( UA_StatusCode code)
nodiscardconstexprnoexcept

Definition at line 58 of file exception.hpp.

Referenced by opcua::StatusCode::isUncertain().

◆ isBad()

bool opcua::detail::isBad ( UA_StatusCode code)
nodiscardconstexprnoexcept

Definition at line 62 of file exception.hpp.

Referenced by opcua::StatusCode::isBad(), and opcua::throwIfBad().

◆ getStatusCode()

UA_StatusCode opcua::detail::getStatusCode ( std::exception_ptr eptr)
inlinenodiscardnoexcept

Definition at line 67 of file exception.hpp.

Referenced by tryInvoke().

◆ clear() [2/3]

void opcua::detail::clear ( UA_AccessControl & ac)
noexcept

◆ clear() [3/3]

void opcua::detail::clear ( UA_Logger & logger)
noexcept

Variable Documentation

◆ clientStateCount

size_t opcua::detail::clientStateCount = 4
inlineconstexpr

Definition at line 27 of file client_context.hpp.

◆ isPointerFree

template<typename T >
bool opcua::detail::isPointerFree
constexpr
Initial value:
T,
UA_StatusCode>::value
std::disjunction< std::is_same< T, Ts >... > IsOneOf
Definition traits.hpp:19
int32_t UA_Int32
_UA_BEGIN_DECLS typedef bool UA_Boolean
uint16_t UA_UInt16
int16_t UA_Int16
int8_t UA_SByte
uint32_t UA_UInt32
int64_t UA_DateTime
float UA_Float
uint32_t UA_StatusCode
double UA_Double
uint8_t UA_Byte
uint64_t UA_UInt64
int64_t UA_Int64

Definition at line 18 of file types_handling.hpp.

Referenced by clear(), copy(), and copyArray().

◆ isConvertibleType

template<typename T >
bool opcua::detail::isConvertibleType = IsConvertibleType<T>::value
constexpr

Definition at line 45 of file typeconverter.hpp.

◆ isRegisteredType

◆ isTypeWrapper

template<typename T >
bool opcua::detail::isTypeWrapper = IsTypeWrapper<T>::value
constexpr

Definition at line 126 of file typewrapper.hpp.

◆ isWrapper

template<typename T >
bool opcua::detail::isWrapper = IsWrapper<T>::value
constexpr