![]() |
TkN 2.2
Toolkit for Nuclei
|
A measured value associated to its unit. More...
A measured value associated to its unit.
see tkn::tkunit_manager for more information
#include <tkunit.h>
Public Member Functions | |
| tkunit () | |
| tkunit (double _value, const tkstring &_unit) | |
| tkunit (double _value, const tkunit_manager::units_keys &_unit) | |
| virtual | ~tkunit () |
| void | clear () |
| reset the data_unit More... | |
| tkunit_manager::units_keys | get_unit_key () const |
| returns the unit key More... | |
| tkstring | get_unit_name () const |
| returns the unit name More... | |
| double | get_value () const |
| get the value in the current unit More... | |
| bool | set_unit (const tkstring &_unit) |
| set the unit from a string More... | |
| bool | set_unit (const tkunit_manager::units_keys &_unit) |
| set the unit from unit key More... | |
| void | set_value (const double &_val, const tkstring &_unit="") |
| set the value and unit from string, if _unit not defined, let in the current unit More... | |
| void | set_value (const double &_val, const tkunit_manager::units_keys &_unit) |
| set the value and unit from unit key, if _unit not defined, let in the current unit More... | |
| tkunit | ( | double | _value, |
| const tkunit_manager::units_keys & | _unit | ||
| ) |
Definition at line 114 of file tkunit.cpp.
|
inline |
|
inline |
|
inline |
| bool set_unit | ( | const tkstring & | _unit | ) |
set the unit from a string
Definition at line 138 of file tkunit.cpp.
| bool set_unit | ( | const tkunit_manager::units_keys & | _unit | ) |
set the unit from unit key
Definition at line 142 of file tkunit.cpp.
| void set_value | ( | const double & | _val, |
| const tkstring & | _unit = "" |
||
| ) |
set the value and unit from string, if _unit not defined, let in the current unit
Definition at line 122 of file tkunit.cpp.
| void set_value | ( | const double & | _val, |
| const tkunit_manager::units_keys & | _unit | ||
| ) |
set the value and unit from unit key, if _unit not defined, let in the current unit
Definition at line 132 of file tkunit.cpp.