open62541pp 0.17.0
C++ wrapper of open62541
|
#include <datatype.hpp>
Builder to create DataType definitions of custom types.
The attributes memSize
, padding
, pointerFree
, isArray
and isOptional
are automatically deduced from the types itself.
Definition at line 257 of file datatype.hpp.
Public Member Functions | |
template<auto U::* field> | |
auto & | addField (const char *fieldName, const UA_DataType &fieldType) |
template<auto U::* field> | |
auto & | addField (const char *fieldName) |
template<auto U::* fieldSize, auto U::* fieldArray> | |
auto & | addField (const char *fieldName, const UA_DataType &fieldType) |
template<auto U::* fieldSize, auto U::* fieldArray> | |
auto & | addField (const char *fieldName) |
template<auto U::* memberUnion, typename TField > | |
auto & | addUnionField (const char *fieldName, const UA_DataType &fieldType) |
template<auto U::* memberUnion, typename TField > | |
auto & | addUnionField (const char *fieldName) |
DataType | build () |
Static Public Member Functions | |
static auto | createEnum (const char *typeName, NodeId typeId, NodeId binaryEncodingId) |
static auto | createStructure (const char *typeName, NodeId typeId, NodeId binaryEncodingId) |
static auto | createUnion (const char *typeName, NodeId typeId, NodeId binaryEncodingId) |
Friends | |
template<typename , typename , typename > | |
class | DataTypeBuilder |
|
static |
Build a DataType definition for an enum.
typeName | Human-readable type name |
typeId | NodeId of the type |
binaryEncodingId | NodeId of data type when encoded as binary |
Definition at line 368 of file datatype.hpp.
|
static |
Build a DataType definition for a structure.
A structure may have optional fields (pointers).
typeName | Human-readable type name |
typeId | NodeId of the type |
binaryEncodingId | NodeId of data type when encoded as binary |
Definition at line 384 of file datatype.hpp.
|
static |
Build a DataType definition for an union.
Union type consist of a switch field and the actual union.
typeName | Human-readable type name |
typeId | NodeId of the type |
binaryEncodingId | NodeId of data type when encoded as binary |
Definition at line 400 of file datatype.hpp.
auto & opcua::DataTypeBuilder< T, Tag, U >::addField | ( | const char * | fieldName, |
const UA_DataType & | fieldType ) |
Add a structure field.
field | Member pointer, e.g. &S::value |
fieldName | Human-readable field name |
fieldType | Member data type |
Definition at line 417 of file datatype.hpp.
|
inline |
Add a structure field (derive DataType from field
).
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 299 of file datatype.hpp.
auto & opcua::DataTypeBuilder< T, Tag, U >::addField | ( | const char * | fieldName, |
const UA_DataType & | fieldType ) |
Add a structure array field.
Arrays must consists of two fields: its size (of type size_t
) and the pointer to the data. No padding allowed between the size field and the array field.
fieldSize | Member pointer to the size field, e.g. &S::length |
fieldArray | Member pointer to the array field, e.g. &S::data |
fieldName | Human-readable field name |
fieldType | Member data type |
Definition at line 446 of file datatype.hpp.
|
inline |
Add a structure array field (derive DataType from fieldArray
).
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 320 of file datatype.hpp.
auto & opcua::DataTypeBuilder< T, Tag, U >::addUnionField | ( | const char * | fieldName, |
const UA_DataType & | fieldType ) |
Add a union field.
memberUnion | Member pointer to the union, e.g. &S::Uni |
TField | Type of the union field |
fieldName | Human-readable field name |
fieldType | Data type of the union field |
Definition at line 477 of file datatype.hpp.
|
inline |
Add a union field (derive DataType from TField
).
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 339 of file datatype.hpp.
|
nodiscard |
Create the actual DataType.
Definition at line 508 of file datatype.hpp.
|
friend |
Definition at line 350 of file datatype.hpp.