Reactions  0.1.1
Handling reaction trees and decays
Classes | Typedefs | Functions | Variables
reactions::units Namespace Reference

Contain functions to determine the scale factors for the given units Units are handled by multiplying values returned by the elements of the reactions by a factor that depends on the unit used as a reference. More...

Classes

struct  accessor_t
 Object to access fields. More...
 
struct  accessor_t< Field >
 Object to access fields. More...
 
struct  accessor_t< Field, Subfield, S... >
 Object to access fields. More...
 
struct  accessor_with_units_t
 Object to access fields and process the units. More...
 
struct  has_units
 Whether a subfield must be modified due to the presence of units. More...
 
struct  has_units< Field >
 Whether a subfield must be modified due to the presence of units. More...
 
struct  is_type_affected_by_units
 Whether a type can be affected by units. More...
 
struct  none
 Represent the abscence of units. More...
 
struct  reference
 Use the template argument as a reference to determine scale factors. More...
 
struct  reference< energy_units, U >
 Use the template argument as a reference to determine scale factors. More...
 
struct  reference< time_units, U >
 Use the template argument as a reference to determine scale factors. More...
 
struct  return_type
 The return type after taking into account the possible units. More...
 

Typedefs

template<class Field , class... Subfield>
using return_type_t = typename return_type< Field, Subfield... >::type
 The return type after taking into account the possible units. More...
 

Functions

auto scale_factor_for (energy_units u)
 Compute the scale factor for the given unit. More...
 
auto scale_factor_for (time_units u)
 Compute the scale factor for the given unit. More...
 

Variables

template<class T >
static constexpr auto is_type_affected_by_units_v
 Whether a type can be affected by units. More...
 
template<class Field , class... Subfield>
static constexpr auto has_units_v = has_units<Field, Subfield...>::value
 Whether a subfield must be modified due to the presence of units. More...
 
template<class Field , class... Subfield>
static constexpr accessor_t< Field, Subfield... > accessor
 Static object to access the fields of a tuple-like object. More...
 
template<class Field , class... Subfield>
static constexpr accessor_with_units_t< Field, Subfield... > accessor_with_units
 Static object to access the fields of a tuple-like object. More...
 

Detailed Description

Contain functions to determine the scale factors for the given units Units are handled by multiplying values returned by the elements of the reactions by a factor that depends on the unit used as a reference.

Units are handled by arguments passed as a SystemOfUnits template argument, which must be instances defining a member function of the form:

template<class Units>
Units const& units() const {
// return the appropriate units here
...
}

implementing the unit to return for each kind of system of units.

Units are defined as C++ enumerations, whose types are:

Typedef Documentation

◆ return_type_t

template<class Field , class... Subfield>
using reactions::units::return_type_t = typedef typename return_type<Field, Subfield...>::type

The return type after taking into account the possible units.

Function Documentation

◆ scale_factor_for() [1/2]

auto reactions::units::scale_factor_for ( energy_units  u)

Compute the scale factor for the given unit.

◆ scale_factor_for() [2/2]

auto reactions::units::scale_factor_for ( time_units  u)

Compute the scale factor for the given unit.

Variable Documentation

◆ accessor

template<class Field , class... Subfield>
constexpr accessor_t<Field, Subfield...> reactions::units::accessor
static

Static object to access the fields of a tuple-like object.

◆ accessor_with_units

template<class Field , class... Subfield>
constexpr accessor_with_units_t<Field, Subfield...> reactions::units::accessor_with_units
static

Static object to access the fields of a tuple-like object.

◆ has_units_v

template<class Field , class... Subfield>
constexpr auto reactions::units::has_units_v = has_units<Field, Subfield...>::value
static

Whether a subfield must be modified due to the presence of units.

◆ is_type_affected_by_units_v

template<class T >
constexpr auto reactions::units::is_type_affected_by_units_v
static
Initial value:
=
is_type_affected_by_units<T>::value

Whether a type can be affected by units.