![]() |
Shamrock 2025.10.0
Astrophysical Code
|
Defines a unit system. More...
#include <shamunits/include/shamunits/UnitSystem.hpp>
Collaboration diagram for shamunits::UnitSystem< T >:Public Member Functions | |
| UnitSystem (T unit_time=1, T unit_length=1, T unit_mass=1, T unit_current=1, T unit_temperature=1, T unit_qte=1, T unit_lumint=1) | |
| Construct a new UnitSystem from either supplied base units or SI by default. | |
| template<UnitPrefix pref = None, units::UnitName u, int power = 1> | |
| constexpr T | get () const noexcept |
| get the value of a units in the current system | |
| template<UnitPrefix pref = None, units::UnitName u, int power = 1> | |
| constexpr T | to () |
| To the si units (convert a system unit to si ones). This function is the inverse of get. | |
| template<units::UnitName u, int power = 1> | |
| constexpr T | get () |
| Simplified signature for get without prefix. | |
| template<units::UnitName u, int power = 1> | |
| constexpr T | to () |
| Simplified signature for to without prefix. | |
| T | runtime_get (UnitPrefix pref, units::UnitName name, int power) |
| Non templated version of get. | |
| T | runtime_to (UnitPrefix pref, units::UnitName name, int power) |
| Non templated version of to. | |
Public Attributes | |
| T | s |
| value of a second in this system | |
| T | m |
| value of a meter in this system | |
| T | kg |
| value of a kilogram in this system | |
| T | A |
| value of a Ampere in this system | |
| T | K |
| value of a Kelvin in this system | |
| T | mol |
| value of a mol in this system | |
| T | cd |
| value of a candela in this system | |
| T | s_inv |
| inverse value of a second in this system | |
| T | m_inv |
| inverse value of a meter in this system | |
| T | kg_inv |
| inverse value of a kilogram in this system | |
| T | A_inv |
| inverse value of a Ampere in this system | |
| T | K_inv |
| inverse value of a Kelvin in this system | |
| T | mol_inv |
| inverse value of a mol in this system | |
| T | cd_inv |
| inverse value of a candela in this system | |
Defines a unit system.
Example of usage :
Definition at line 77 of file UnitSystem.hpp.
|
inlineexplicit |
Construct a new UnitSystem from either supplied base units or SI by default.
| unit_time | |
| unit_length | |
| unit_mass | |
| unit_current | |
| unit_temperature | |
| unit_qte | |
| unit_lumint |
Definition at line 148 of file UnitSystem.hpp.
|
inlineconstexpr |
Simplified signature for get without prefix.
Definition at line 240 of file UnitSystem.hpp.
|
inlineconstexprnoexcept |
get the value of a units in the current system
| pref | unit prefix (default to none) |
| u | the units |
| power | the power of the units (also applied to the prefix) |
|
inline |
Non templated version of get.
Definition at line 319 of file UnitSystem.hpp.
|
inline |
Non templated version of to.
Definition at line 324 of file UnitSystem.hpp.
|
inlineconstexpr |
To the si units (convert a system unit to si ones). This function is the inverse of get.
| pref | unit prefix (default to none) |
| u | the units |
| power | the power of the units (also applied to the prefix) |
Definition at line 234 of file UnitSystem.hpp.
Here is the call graph for this function:
|
inlineconstexpr |
Simplified signature for to without prefix.
Definition at line 246 of file UnitSystem.hpp.
| shamunits::UnitSystem< T >::A |
value of a Ampere in this system
Definition at line 134 of file UnitSystem.hpp.
| shamunits::UnitSystem< T >::A_inv |
inverse value of a Ampere in this system
Definition at line 135 of file UnitSystem.hpp.
| shamunits::UnitSystem< T >::cd |
value of a candela in this system
Definition at line 134 of file UnitSystem.hpp.
| shamunits::UnitSystem< T >::cd_inv |
inverse value of a candela in this system
Definition at line 135 of file UnitSystem.hpp.
| shamunits::UnitSystem< T >::K |
value of a Kelvin in this system
Definition at line 134 of file UnitSystem.hpp.
| shamunits::UnitSystem< T >::K_inv |
inverse value of a Kelvin in this system
Definition at line 135 of file UnitSystem.hpp.
| shamunits::UnitSystem< T >::kg |
value of a kilogram in this system
Definition at line 134 of file UnitSystem.hpp.
| shamunits::UnitSystem< T >::kg_inv |
inverse value of a kilogram in this system
Definition at line 135 of file UnitSystem.hpp.
| shamunits::UnitSystem< T >::m |
value of a meter in this system
Definition at line 134 of file UnitSystem.hpp.
| shamunits::UnitSystem< T >::m_inv |
inverse value of a meter in this system
Definition at line 135 of file UnitSystem.hpp.
| shamunits::UnitSystem< T >::mol |
value of a mol in this system
Definition at line 134 of file UnitSystem.hpp.
| shamunits::UnitSystem< T >::mol_inv |
inverse value of a mol in this system
Definition at line 135 of file UnitSystem.hpp.
| shamunits::UnitSystem< T >::s |
value of a second in this system
Definition at line 134 of file UnitSystem.hpp.
| shamunits::UnitSystem< T >::s_inv |
inverse value of a second in this system
Definition at line 135 of file UnitSystem.hpp.