18 #ifndef UNIT_CONVERTER_HH_ 19 #define UNIT_CONVERTER_HH_ 42 <<
"Invalid definition of unit: " << EI_UnitDefinition::qval <<
"\n" << EI_UnitError::val <<
".\n");
44 <<
"Non-corresponding definition of unit: " << EI_UnitDefinition::qval <<
"\nExpected: unit with base format " 45 << EI_ExpectedUnit::qval <<
".\n");
51 Factor() : exponent_(1), basic_(true) {}
52 Factor(std::string factor,
int exponent,
bool basic =
true) : factor_(factor), exponent_(exponent), basic_(basic) {}
112 double convert(std::string actual_unit);
116 ASSERT(unit_si_.is_def()).error(
"UnitSI is not defined, first call convert method.");
UnitSI unit_
derived SI unit
Helper class. Defines basic factors of SI, non-SI and derived units.
UnitsMap units_map_
Define all base and derived units given by their symbol.
bool basic_
unit is basic (strict defined in application) / derived (defined by user as formula) ...
UnitSI unit_si() const
Return unit_si_.
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library...
std::map< std::string, struct DerivedUnit > UnitsMap
Yes & convert(fmt::ULongLong)
Factor(std::string factor, int exponent, bool basic=true)
std::string factor_
string represantation of unit or user defined constant
Store structure given by parser.
std::map< std::string, struct Formula > UnitData
Class for representation SI units of Fields.
static const BasicFactors basic_factors
Define all base and derived units given by their symbol.
double coef_
multiplicative coeficient