Flow123d  release_2.2.0-26-ge868538
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
UnitConverter Class Reference

#include <unit_converter.hh>

Collaboration diagram for UnitConverter:
Collaboration graph
[legend]

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_
 

Detailed Description

Definition at line 85 of file unit_converter.hh.

Constructor & Destructor Documentation

UnitConverter::UnitConverter ( )

Constructor.

Definition at line 88 of file unit_converter.cc.

Member Function Documentation

void UnitConverter::add_converted_unit ( Factor  factor,
UnitData unit_data,
UnitSI unit_si,
double &  coef 
)
protected

Calculates UnitSi and coeficient of Factor, recursively calls this method for user defined formula.

Definition at line 135 of file unit_converter.cc.

Here is the caller graph for this function:

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.

Here is the caller graph for this function:

UnitData UnitConverter::read_unit ( std::string  s)
protected

Parse and check unit defined in string format.

Return data in format UnitData

Definition at line 95 of file unit_converter.cc.

Here is the caller graph for this function:

UnitSI UnitConverter::unit_si ( ) const
inline

Return unit_si_.

Definition at line 97 of file unit_converter.hh.

Here is the caller graph for this function:

Member Data Documentation

const BasicFactors UnitConverter::basic_factors = BasicFactors()
static

Define all base and derived units given by their symbol.

Definition at line 88 of file unit_converter.hh.

double UnitConverter::coef_
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 119 of file unit_converter.hh.

UnitSI UnitConverter::unit_si_
protected

Basic format of converted SI unit

Definition at line 124 of file unit_converter.hh.


The documentation for this class was generated from the following files: