Utility class for a complete valid data definition of one EnumType and its dependencies. More...
#include <ddenum.h>
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. | |
DDEnum & | operator= (const DDEnum &other) |
copies a DDEnum object | |
DDEnum (const std::string &name, const dd::DataType &data_type, const std::vector< dd::EnumType::Element > &elements={}) | |
Construct a new DDEnum object. | |
DDEnum (const std::string &name, const DDDataType &data_type, const std::vector< dd::EnumType::Element > &elements={}) | |
Construct a new DDEnum object. | |
DDEnum & | addElement (const dd::EnumType::Element &element) |
adds a EnumType element. | |
DDEnum & | addElement (const std::string &name, int64_t value) |
adds a EnumType element. | |
DDEnum & | addElements (const std::vector< dd::EnumType::Element > &elements) |
adds a vector of EnumType elements. | |
const dd::EnumType & | getEnumType () const |
Get the Enum Type object. | |
const dd::DataDefinition & | getDD () const |
return the valid data definition. | |
size_t | getTypeByteSize () const |
returns the size of the underlying datatype. | |
size_t | getAlignment () const |
returns the alignment of the underlying datatype. | |
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 .
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 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. |
References DDEnum().
Referenced by DDEnumGenerator< Type >::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. |
References DDEnum().
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. |
References DDEnum().
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().
|
private |
|
private |