open62541pp 0.19.0
C++ wrapper of open62541
Loading...
Searching...
No Matches
opcua::TypeConverter< T, Enable > Struct Template Reference

Detailed Description

template<typename T, typename Enable = void>
struct opcua::TypeConverter< T, Enable >

Type conversion from and to native types.

Native types can be both UA_* types and wrapper classes (like UA_Guid and Guid). The TypeConverter is mainly used within the Variant class to set/get non-native types.

Template specializations can be added for conversions of arbitrary types:

namespace ::opcua {
template <>
struct TypeConverter<MyGuid> {
using NativeType = UA_Guid;
[[nodiscard]] static MyGuid fromNative(const UA_Guid& src) { ... }
[[nodiscard]] static UA_Guid toNative(const MyGuid& src) { ... }
};
}
Type conversion from and to native types.

Definition at line 26 of file typeconverter.hpp.