ADTF  3.18.2
DDEnumGenerator< EnumDataType, typename std::enable_if< std::is_arithmetic< EnumDataType >::value >::type >

This is used to create an enumeration type independently. More...

Inheritance diagram for DDEnumGenerator< EnumDataType, typename std::enable_if< std::is_arithmetic< EnumDataType >::value >::type >:
[legend]

Public Member Functions

 DDEnumGenerator (const std::string &name, const std::vector< std::pair< std::string, EnumDataType >> elements={})
 CTOR. 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>
class ddl::DDEnumGenerator< EnumDataType, typename std::enable_if< std::is_arithmetic< EnumDataType >::value >::type >

This is used to create an enumeration type independently.

Example Usages

auto my_enum_type = DDEnumGenerator<uint8_t>("MyEnum")
.addElement("eA", 0)
.addElement("eB", 1);
Template Parameters
EnumDataTypeThe type of the enum .

Definition at line 197 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 207 of file ddenum.h.