15#ifndef DD_PREDEFINED_UNITS_H_INCLUDED
16#define DD_PREDEFINED_UNITS_H_INCLUDED
23#include <unordered_map>
73#define DDL_BASE_UNIT_DEFINITION(classname, baseunitname, baseunitsymbol, baseunitdescription) \
76 constexpr static const char* const _name = baseunitname; \
77 constexpr static const char* const _symbol = baseunitsymbol; \
78 constexpr static const char* const _description = baseunitdescription; \
81 static_assert(true, "Simply to make sure a closing semicolon ';' is used for the macro")
91#define DDL_UNIT_PREFIX_DEFINITION(classname, unitprefixname, unitprefixsymbol, unitprefixpower) \
92 namespace unit_prefix { \
94 constexpr static const char* const _name = unitprefixname; \
95 constexpr static const char* const _symbol = unitprefixsymbol; \
96 constexpr static const int32_t _power = unitprefixpower; \
99 static_assert(true, "Simply to make sure a closing semicolon ';' is used for the macro")
179class PredefinedUnits {
213 const std::string& name)
const;
229 const std::unordered_map<std::string, std::shared_ptr<dd::datamodel::BaseUnit>>
231 const std::unordered_map<std::string, std::shared_ptr<dd::datamodel::UnitPrefix>>
232 _defined_unit_prefixes;
static const PredefinedUnits & getInstance()
Get the Instance object.
std::vector< std::shared_ptr< dd::datamodel::BaseUnit > > getPredefinedBaseUnits() const
Gets a vector of all the predefined base units.
std::vector< std::shared_ptr< dd::datamodel::UnitPrefix > > getPredefinedUnitPrefixes() const
Gets a vector of all the predefined unit prefixes types.
std::shared_ptr< dd::datamodel::BaseUnit > getPredefinedBaseUnit(const std::string &name) const
Get the Predefined Base Unit by name.
std::shared_ptr< dd::datamodel::UnitPrefix > getPredefinedUnitPrefix(const std::string &name) const
Get the Predefined Unit Prefix by name.
BaseUnit.
Definition datamodel_units.h:108
Unit Prefix - datamodel pefixes.
Definition datamodel_units.h:221
#define DDL_UNIT_PREFIX_DEFINITION(classname, unitprefixname, unitprefixsymbol, unitprefixpower)
Unit prefix template definiton.
Definition dd_predefined_units.h:91
#define DDL_BASE_UNIT_DEFINITION(classname, baseunitname, baseunitsymbol, baseunitdescription)
Definition dd_predefined_units.h:73
definiton of the unit prefixes namespace
Definition dd_predefined_units.h:61
definiton of the unit namespace
Definition dd_predefined_units.h:55
definition of the ddl namespace
Definition codec.h:21