ADTF  3.18.2
DDEnumGenerator< EnumDataType, Enable >

This is used to create the DD representation of an enumeration type. More...

Inheritance diagram for DDEnumGenerator< EnumDataType, Enable >:
[legend]

Public Member Functions

 DDEnumGenerator (const std::string &name, const std::vector< std::pair< std::string, EnumDataType >> elements={})
 CTOR. More...
 
DDEnumGeneratoraddElement (const std::string &name, EnumDataType value)
 Adds a element for the enumeration with name and value. More...
 
- Public Member Functions inherited from DDEnum
 DDEnum ()=delete
 Construct a new DDEnum object.
 
 DDEnum (DDEnum &&)
 Construct a new DDEnum object.
 
DDEnumoperator= (DDEnum &&)
 
 DDEnum (const DDEnum &other)
 Construct a new DDEnum object. More...
 
DDEnumoperator= (const DDEnum &other)
 copies a DDEnum object More...
 
 DDEnum (const std::string &name, const dd::DataType &data_type, const std::vector< dd::EnumType::Element > &elements={})
 Construct a new DDEnum object. More...
 
 DDEnum (const std::string &name, const DDDataType &data_type, const std::vector< dd::EnumType::Element > &elements={})
 Construct a new DDEnum object. More...
 
DDEnumaddElement (const dd::EnumType::Element &element)
 adds a EnumType element. More...
 
DDEnumaddElement (const std::string &name, int64_t value)
 adds a EnumType element. More...
 
DDEnumaddElements (const std::vector< dd::EnumType::Element > &elements)
 adds a vector of EnumType elements. More...
 
const dd::EnumTypegetEnumType () const
 Get the Enum Type object. More...
 
const dd::DataDefinitiongetDD () const
 return the valid data definition. More...
 
size_t getAlignment () const
 returns the alignment of the underlying data type. More...
 

Detailed Description

template<typename EnumDataType, typename Enable = void>
class ddl::DDEnumGenerator< EnumDataType, Enable >

This is used to create the DD representation of an enumeration type.

Example Usages

enum MyEnum : uint8_t {eA, eB};
auto my_enum_type = DDEnumGenerator<MyEnum>("MyEnum")
.addElement("eA", eA)
.addElement("eB", eB);
Template Parameters
EnumDataTypeThe type of the enum .
Enabletype trait

Definition at line 148 of file ddenum.h.

Constructor & Destructor Documentation

◆ DDEnumGenerator()

DDEnumGenerator ( const std::string &  name,
const std::vector< std::pair< std::string, EnumDataType >>  elements = {} 
)
inline

CTOR.

Parameters
namethe name of the enum for DataDefinition
elementsthe elements of the enumeration

Definition at line 156 of file ddenum.h.

Member Function Documentation

◆ addElement()

DDEnumGenerator& addElement ( const std::string &  name,
EnumDataType  value 
)
inline

Adds a element for the enumeration with name and value.

Parameters
namethe name of the enumeration value
valuethe value for the name out of given type EnumDataType
Returns
DDEnumGenerator& a reference of this

Definition at line 176 of file ddenum.h.

References DDEnum::addElement(), and A_UTILS_NS::to_string().