|
base
|
#include <Temperature.hpp>
Public Member Functions | |
| Temperature () | |
| double | getKelvin () const |
| double | getCelsius () const |
| bool | isInRange (const Temperature &left_limit, const Temperature &right_limit) const |
| bool | isApprox (Temperature other, double prec=1e-5) const |
| void | operator= (const Temperature &other) |
| bool | operator== (const Temperature &other) const |
| bool | operator< (const Temperature &other) const |
| bool | operator> (const Temperature &other) const |
Static Public Member Functions | |
| static double | kelvin2Celsius (double kelvin) |
| static double | celsius2Kelvin (double celsius) |
| static Temperature | fromKelvin (double kelvin) |
| static Temperature | fromCelsius (double celsius) |
Public Attributes | |
| double | kelvin |
Protected Member Functions | |
| Temperature (double kelvin) | |
This class represents a temperature, and can be used instead of double for convenience. The class has a canonical representation of the temperature in kelvin.
| base::Temperature::Temperature | ( | ) |
default constructor, which will leave the temperature uninitialized.
|
explicitprotected |
|
static |
static conversion from celsius to kelvin
| celsius | temperature in celsius |
|
static |
use this method to get temperature from Celsius
| celsius | - temperature in celsius. |
|
static |
use this method to get temperature from Kelvin.
| kelvin | - temperature in Kelvin. |
| double base::Temperature::getCelsius | ( | ) | const |
| double base::Temperature::getKelvin | ( | ) | const |
| bool base::Temperature::isApprox | ( | Temperature | other, |
| double | prec = 1e-5 |
||
| ) | const |
compare two temperatures for approximate equality
| other | - temperature to compare |
| prec | - precision interval in kelvin |
| bool base::Temperature::isInRange | ( | const Temperature & | left_limit, |
| const Temperature & | right_limit | ||
| ) | const |
|
static |
static conversion from kelvin to celsius
| kelvin | temperature in kelvin |
| bool base::Temperature::operator< | ( | const Temperature & | other | ) | const |
| void base::Temperature::operator= | ( | const Temperature & | other | ) |
| bool base::Temperature::operator== | ( | const Temperature & | other | ) | const |
| bool base::Temperature::operator> | ( | const Temperature & | other | ) | const |
| double base::Temperature::kelvin |
temperature in kelvins
1.8.13