open62541pp 0.18.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 308 of file datatype.hpp.
Public Member Functions | |
template<auto U::* field> | |
auto & | addField (std::string_view fieldName, const UA_DataType &fieldType) |
template<auto U::* field> | |
auto & | addField (std::string_view fieldName) |
template<auto U::* fieldSize, auto U::* fieldArray> | |
auto & | addField (std::string_view fieldName, const UA_DataType &fieldType) |
template<auto U::* fieldSize, auto U::* fieldArray> | |
auto & | addField (std::string_view fieldName) |
template<auto U::* memberUnion, typename TField > | |
auto & | addUnionField (std::string_view fieldName, const UA_DataType &fieldType) |
template<auto U::* memberUnion, typename TField > | |
auto & | addUnionField (std::string_view fieldName) |
DataType | build () |
Static Public Member Functions | |
static auto | createEnum (std::string_view typeName, NodeId typeId, NodeId binaryEncodingId) |
static auto | createStructure (std::string_view typeName, NodeId typeId, NodeId binaryEncodingId) |
static auto | createUnion (std::string_view 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 419 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 435 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 451 of file datatype.hpp.
auto & opcua::DataTypeBuilder< T, Tag, U >::addField | ( | std::string_view | 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 468 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 350 of file datatype.hpp.
auto & opcua::DataTypeBuilder< T, Tag, U >::addField | ( | std::string_view | 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 495 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 371 of file datatype.hpp.
auto & opcua::DataTypeBuilder< T, Tag, U >::addUnionField | ( | std::string_view | 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 528 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 390 of file datatype.hpp.
DataType opcua::DataTypeBuilder< T, Tag, U >::build | ( | ) |
Create the actual DataType.
Definition at line 555 of file datatype.hpp.
|
friend |
Definition at line 401 of file datatype.hpp.