|
thermo 1.0.0
Type-safe temperature handling library modeled after std::chrono
|
A temperature difference with a representation and precision. More...
#include <thermo/thermo.hpp>
Public Types | |
| using | rep = Rep |
| The representation type. | |
| using | precision = typename Precision::type |
| The precision as a std::ratio. | |
Static Public Member Functions | |
| static constexpr delta | zero () noexcept |
| Returns a zero-length delta. | |
| static constexpr delta | min () noexcept |
| Returns the minimum (most negative) representable delta. | |
| static constexpr delta | max () noexcept |
| Returns the maximum representable delta. | |
A temperature difference with a representation and precision.
Similar to std::chrono::duration, delta represents the difference between two temperatures. The precision is expressed as a std::ratio of one base unit (Kelvin or Celsius degree).
| Rep | Arithmetic type for the tick count. |
| Precision | A std::ratio representing the precision (default: 1). |
Definition at line 120 of file thermo.hpp.
| using thermo::delta< Rep, Precision >::precision = typename Precision::type |
The precision as a std::ratio.
Definition at line 129 of file thermo.hpp.
The representation type.
Definition at line 127 of file thermo.hpp.
|
constexprdefault |
Constructs a zero delta.
Referenced by thermo::delta< Rep, Precision >::max(), thermo::delta< Rep, Precision >::min(), thermo::delta< Rep, Precision >::operator++(), thermo::delta< Rep, Precision >::operator--(), and thermo::delta< Rep, Precision >::zero().
|
inlineexplicitconstexpr |
Constructs from a tick count.
Implicit for inexact types, explicit otherwise to prevent accidental precision loss.
| Rep2 | The source representation type. |
| r | The tick count. |
Definition at line 146 of file thermo.hpp.
|
inlineconstexpr |
Constructs from another delta with different representation or precision.
Implicit when the conversion is lossless (target precision evenly divides source precision). Explicit otherwise.
| Rep2 | Source representation type. |
| Precision2 | Source precision. |
| temp | The source delta. |
Definition at line 162 of file thermo.hpp.
|
inlineconstexpr |
Returns the tick count.
Definition at line 169 of file thermo.hpp.
Referenced by thermo::delta_cast(), thermo::delta< Rep, Precision >::operator+=(), thermo::delta< Rep, Precision >::operator-=(), thermo::operator/(), thermo::operator<=>(), and thermo::operator==().
Returns the maximum representable delta.
Definition at line 234 of file thermo.hpp.
References thermo::delta< Rep, Precision >::delta().
Returns the minimum (most negative) representable delta.
Definition at line 231 of file thermo.hpp.
References thermo::delta< Rep, Precision >::delta().
|
inlineconstexpr |
Definition at line 220 of file thermo.hpp.
|
inlineconstexpr |
Definition at line 213 of file thermo.hpp.
|
inlineconstexpr |
Definition at line 203 of file thermo.hpp.
|
inlineconstexpr |
Definition at line 171 of file thermo.hpp.
|
inlineconstexpr |
Definition at line 179 of file thermo.hpp.
|
inlineconstexpr |
Definition at line 184 of file thermo.hpp.
References thermo::delta< Rep, Precision >::delta().
|
inlineconstexpr |
Definition at line 193 of file thermo.hpp.
References thermo::delta< Rep, Precision >::count().
|
inlineconstexpr |
Definition at line 175 of file thermo.hpp.
|
inlineconstexpr |
Definition at line 186 of file thermo.hpp.
|
inlineconstexpr |
Definition at line 191 of file thermo.hpp.
References thermo::delta< Rep, Precision >::delta().
|
inlineconstexpr |
Definition at line 198 of file thermo.hpp.
References thermo::delta< Rep, Precision >::count().
|
inlineconstexpr |
Definition at line 208 of file thermo.hpp.
|
default |
Returns a zero-length delta.
Definition at line 228 of file thermo.hpp.
References thermo::delta< Rep, Precision >::delta().