15 #ifndef DDENUM_H_INCLUDED
16 #define DDENUM_H_INCLUDED
69 const std::vector<dd::EnumType::Element>& elements = {});
82 const std::vector<dd::EnumType::Element>& elements = {});
138 std::shared_ptr<dd::EnumType> _enum_type;
154 template <
typename EnumDataType,
typename Enable =
void>
164 const std::vector<std::pair<std::string, EnumDataType>> elements = {})
165 :
DDEnum(name,
DataType<
typename std::underlying_type<EnumDataType>::type>())
167 for (
const auto& elem: elements) {
171 static_cast<typename std::underlying_type<EnumDataType>::type
>(elem.second))));
187 std::to_string(
static_cast<typename std::underlying_type<EnumDataType>::type
>(value))));
203 template <
typename EnumDataType>
205 typename std::enable_if<std::is_arithmetic<EnumDataType>::value>::type>
215 const std::vector<std::pair<std::string, EnumDataType>> elements = {})
218 for (
const auto& elem: elements) {
A DataType class holding the DD for a Datatype with dependencies.
DDEnumGenerator(const std::string &name, const std::vector< std::pair< std::string, EnumDataType >> elements={})
CTOR.
This is used to create the DD representation of an enumeration type.
DDEnumGenerator & addElement(const std::string &name, EnumDataType value)
Adds a element for the enumeration with name and value.
DDEnumGenerator(const std::string &name, const std::vector< std::pair< std::string, EnumDataType >> elements={})
CTOR.
Utility class for a complete valid data definition of one EnumType and its dependencies.
DDEnum(DDEnum &&)
Construct a new DDEnum object.
DDEnum & operator=(DDEnum &&)
const dd::DataDefinition & getDD() const
return the valid data definition.
DDEnum(const std::string &name, const dd::DataType &data_type, const std::vector< dd::EnumType::Element > &elements={})
Construct a new DDEnum object.
DDEnum & operator=(const DDEnum &other)
copies a DDEnum object
dd::DataDefinition _dd
the data definition
DDEnum & addElement(const std::string &name, int64_t value)
adds a EnumType element.
DDEnum(const std::string &name, const DDDataType &data_type, const std::vector< dd::EnumType::Element > &elements={})
Construct a new DDEnum object.
size_t getAlignment() const
returns the alignment of the underlying datatype.
const dd::EnumType & getEnumType() const
Get the Enum Type object.
DDEnum(const DDEnum &other)
Construct a new DDEnum object.
DDEnum & addElement(const dd::EnumType::Element &element)
adds a EnumType element.
DDEnum & addElements(const std::vector< dd::EnumType::Element > &elements)
adds a vector of EnumType elements.
size_t getTypeByteSize() const
returns the size of the underlying datatype.
DDEnum()=delete
Construct a new DDEnum object.
Generator template to create DataType for the plain c-types.
The Data Definiton class uses the validation model to keep a Data Definition datamodel (ddl::dd::data...
observable DataDefinition object class to describe (POD) DataType.
observable DataDefinition object class to describe EnumType.
OO DataDefinition - Data Definition.
OO DataDefinition DataTypes header for template based DataType usages.
cString to_string(const tResult &i_oResult, eResultFormatFlags i_eFormatFlags=eResultFormatFlags::RFF_DisableNone, const tChar *i_strFormat=nullptr)
Copy all information of an assigned result object to a (formatted) string.
@ data_type
the type is a data type (DataType)
definition of the ddl namespace
Utility for the Neutrino gcc5 compiler which has really no std::to_string implementation!