Flow123d
JS_before_hm-989-g79825ac
|
#include <unit_converter.hh>
Public Member Functions | |
UnitConverter () | |
Constructor. More... | |
double | convert (std::string actual_unit) |
Convert string to coeficient and UnitSI representation, return coeficient. More... | |
UnitSI | unit_si () const |
Return unit_si_ . More... | |
Static Public Attributes | |
static const BasicFactors | basic_factors = BasicFactors() |
Define all base and derived units given by their symbol. More... | |
Protected Member Functions | |
UnitData | read_unit (std::string s) |
Parse and check unit defined in string format. More... | |
void | add_converted_unit (Factor factor, UnitData &unit_data, UnitSI &unit_si, double &coef) |
Calculates UnitSi and coeficient of Factor, recursively calls this method for user defined formula. More... | |
Protected Attributes | |
double | coef_ |
UnitSI | unit_si_ |
Definition at line 87 of file unit_converter.hh.
UnitConverter::UnitConverter | ( | ) |
Constructor.
Definition at line 88 of file unit_converter.cc.
|
protected |
Calculates UnitSi and coeficient of Factor, recursively calls this method for user defined formula.
Definition at line 135 of file unit_converter.cc.
double UnitConverter::convert | ( | std::string | actual_unit | ) |
Convert string to coeficient and UnitSI representation, return coeficient.
Definition at line 121 of file unit_converter.cc.
|
protected |
Parse and check unit defined in string format.
Return data in format UnitData
Definition at line 95 of file unit_converter.cc.
|
inline |
Return unit_si_
.
Definition at line 99 of file unit_converter.hh.
|
static |
Define all base and derived units given by their symbol.
Definition at line 90 of file unit_converter.hh.
|
protected |
Coeficient of unit.
Coeficient is used if unit is not in basic format. Example: if the unit is specified in minutes, coeficient has value 60.
Definition at line 121 of file unit_converter.hh.
|
protected |
Basic format of converted SI unit
Definition at line 126 of file unit_converter.hh.