ADTF
|
Utility class for a complete valid data definition of one EnumType and its dependencies. More...
Public Member Functions | |
DDEnum ()=delete | |
Construct a new DDEnum object. | |
DDEnum (DDEnum &&) | |
Construct a new DDEnum object. | |
DDEnum & | operator= (DDEnum &&) |
DDEnum (const DDEnum &other) | |
Construct a new DDEnum object. More... | |
DDEnum & | operator= (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... | |
DDEnum & | addElement (const dd::EnumType::Element &element) |
adds a EnumType element. More... | |
DDEnum & | addElement (const std::string &name, int64_t value) |
adds a EnumType element. More... | |
DDEnum & | addElements (const std::vector< dd::EnumType::Element > &elements) |
adds a vector of EnumType elements. More... | |
const dd::EnumType & | getEnumType () const |
Get the Enum Type object. More... | |
const dd::DataDefinition & | getDD () const |
return the valid data definition. More... | |
size_t | getTypeByteSize () const |
returns the size of the underlying datatype. More... | |
size_t | getAlignment () const |
returns the alignment of the underlying datatype. More... | |
Private Attributes | |
dd::DataDefinition | _dd |
the data definition | |
std::shared_ptr< dd::EnumType > | _enum_type |
Utility class for a complete valid data definition of one EnumType and its dependencies.
This class is for convenience to use it together with ddl::DDStructure .
Construct a new DDEnum object.
other | the enum type definition to copy |
DDEnum | ( | const std::string & | name, |
const dd::DataType & | data_type, | ||
const std::vector< dd::EnumType::Element > & | elements = {} |
||
) |
Construct a new DDEnum object.
name | name of the enum type. |
data_type | base data type to use (see templates ddl::DataType). |
elements | vector of element of the enum type. |
ddl::dd::Error | throws if elements with the same name are added. |
DDEnum | ( | const std::string & | name, |
const DDDataType & | data_type, | ||
const std::vector< dd::EnumType::Element > & | elements = {} |
||
) |
Construct a new DDEnum object.
name | name of the enum type. |
data_type | the data type to use (use this if you created a new datatype with units i.e. ) |
elements | vector of element of the enum type. |
ddl::dd::Error | throws if elements with the same name are added. |
DDEnum& addElement | ( | const dd::EnumType::Element & | element | ) |
adds a EnumType element.
element | the elment to add. |
ddl::dd::Error | throws if element with the same name already exists. |
Referenced by DDEnumGenerator< EnumDataType, Enable >::addElement().
DDEnum& addElement | ( | const std::string & | name, |
int64_t | value | ||
) |
adds a EnumType element.
name | the name of the element to add. |
value | the name of the element (if it is an integer value). |
ddl::dd::Error | throws if element with the same name already exists. |
DDEnum& addElements | ( | const std::vector< dd::EnumType::Element > & | elements | ) |
adds a vector of EnumType elements.
elements | the elments to add. |
ddl::dd::Error | throws if element with the same name already exists. |
size_t getAlignment | ( | ) | const |
returns the alignment of the underlying datatype.
Referenced by enumeration< Type >::GetAlignment().
const dd::DataDefinition& getDD | ( | ) | const |
return the valid data definition.
const dd::EnumType& getEnumType | ( | ) | const |
Get the Enum Type object.
size_t getTypeByteSize | ( | ) | const |
returns the size of the underlying datatype.
Referenced by enumeration< Type >::GetSize().
copies a DDEnum object
other | the enum type definition to copy |