Flow123d  master-f44eb46
Public Member Functions | Static 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)
 
UnitSI unit_si () const
 Return unit_si_. More...
 

Static Public Member Functions

static const Input::Type::Recordget_input_type ()
 

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 93 of file unit_converter.hh.

Constructor & Destructor Documentation

◆ UnitConverter()

UnitConverter::UnitConverter ( )

Constructor.

Definition at line 127 of file unit_converter.cc.

Member Function Documentation

◆ add_converted_unit()

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 174 of file unit_converter.cc.

Here is the caller graph for this function:

◆ convert()

double UnitConverter::convert ( std::string  actual_unit)

Definition at line 160 of file unit_converter.cc.

Here is the caller graph for this function:

◆ get_input_type()

const Input::Type::Record & UnitConverter::get_input_type ( )
static

Definition at line 101 of file unit_converter.cc.

Here is the caller graph for this function:

◆ read_unit()

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

Parse and check unit defined in string format.

Return data in format UnitData

Definition at line 134 of file unit_converter.cc.

Here is the caller graph for this function:

◆ unit_si()

UnitSI UnitConverter::unit_si ( ) const
inline

Return unit_si_.

Definition at line 115 of file unit_converter.hh.

Here is the caller graph for this function:

Member Data Documentation

◆ basic_factors

const BasicFactors UnitConverter::basic_factors = BasicFactors()
static

Define all base and derived units given by their symbol.

Definition at line 96 of file unit_converter.hh.

◆ coef_

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 137 of file unit_converter.hh.

◆ unit_si_

UnitSI UnitConverter::unit_si_
protected

Basic format of converted SI unit

Definition at line 142 of file unit_converter.hh.


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