Reactions  0.0.0
Handling reaction trees and decays
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
reactions::database Namespace Reference

Utilities to handle database objects and their elements. More...

Namespaces

 detail
 Internal utilitites for the reactions::database namespace.
 

Classes

struct  error
 Field for an error. More...
 
struct  error_lower
 Field for a lower error. More...
 
struct  error_upper
 Field for an lower error. More...
 
struct  get_t
 Type defining an accessor to a value/error field. More...
 
struct  get_t< error >
 Accessor to the error. More...
 
struct  get_t< error_lower >
 Accessor to the lower error. More...
 
struct  get_t< error_upper >
 Accessor to the upper error. More...
 
struct  get_t< value >
 Accessor to the value. More...
 
struct  is_optional
 Check if a type represents an optional. More...
 
struct  is_optional< std::optional< T > >
 Check if a type represents an optional. More...
 
struct  is_optional_field
 Contain the information whether a field is optional or not. More...
 
struct  is_optional_field< F, std::enable_if_t< is_optional_v< typename F::value_type > > >
 Contain the information whether a field is optional or not. More...
 
struct  overall_range
 Get the overall range for a range with/without subranges. More...
 
struct  overall_range< range_collection< R0, R..., Rn > >
 Overall range of a variable (that can be a composite) More...
 
struct  range
 Define a range with minimum and maximum indices. More...
 
struct  remove_optional
 If the input type is an optional, get the underying type. More...
 
struct  remove_optional< std::optional< T > >
 If the input type is an optional, get the underying type. More...
 
struct  underlying_types
 Define a std::tuple with the types of the fields provided. More...
 
struct  underlying_types< std::tuple< F... > >
 Define a std::tuple with the types of the fields provided. More...
 
struct  value
 Field for a value. More...
 
struct  value_and_errors
 Simple structure composed by a value and the lower and upper errors. More...
 
struct  value_and_errors< T, std::enable_if_t< std::is_floating_point_v< T >, void > >
 Empty constructor. More...
 

Typedefs

template<class T >
using remove_optional_t = typename remove_optional< T >::type
 If the input type is an optional, get the underying type. More...
 
template<class... R>
using range_collection = std::tuple< R... >
 Define a collection of ranges (a single variable with subvariables) More...
 
template<class R >
using overall_range_t = typename overall_range< R >::type
 Overall range of a variable (that can be a composite) More...
 
using float_opt = std::optional< float >
 Optional for float type. More...
 
using double_opt = std::optional< double >
 Optional for double type. More...
 
using ve_float_opt = std::optional< value_and_errors< float > >
 Optional value_and_errors for single-precision floating-point type. More...
 
using ve_double_opt = std::optional< value_and_errors< double > >
 Optional value_and_errors for double-precision floating-point type. More...
 

Enumerations

enum  conversion_status : int { success, empty, failed }
 Status code of a conversion to an arithmetic or std::optional type. More...
 

Functions

template<class T >
constexpr auto const & access_value (T const &c)
 
template<class T >
constexpr auto const & access_value (std::optional< T > const &opt)
 
template<class Range , class T >
conversion_status read_field (T &out, std::string const &s)
 Read a field in a line from a file. More...
 
template<class Ranges , class T >
conversion_status read_field (value_and_errors< T > &out, std::string const &s)
 Read a field composed by value and errors in a line from a file. More...
 

Variables

template<class T >
constexpr auto is_optional_v = is_optional<T>::value
 Alias to check if a type represents an optional. More...
 
template<class F >
constexpr auto is_optional_field_v = is_optional_field<F>::value
 Contain the information whether a field is optional or not. More...
 
template<class F >
static constexpr get_t< F > get
 Accessor to a value/error field. More...
 

Detailed Description

Utilities to handle database objects and their elements.

Typedef Documentation

◆ double_opt

Optional for double type.

◆ float_opt

Optional for float type.

◆ overall_range_t

template<class R >
using reactions::database::overall_range_t = typedef typename overall_range<R>::type

Overall range of a variable (that can be a composite)

◆ range_collection

template<class... R>
using reactions::database::range_collection = typedef std::tuple<R...>

Define a collection of ranges (a single variable with subvariables)

◆ remove_optional_t

template<class T >
using reactions::database::remove_optional_t = typedef typename remove_optional<T>::type

If the input type is an optional, get the underying type.

◆ ve_double_opt

Optional value_and_errors for double-precision floating-point type.

◆ ve_float_opt

Optional value_and_errors for single-precision floating-point type.

Enumeration Type Documentation

◆ conversion_status

Status code of a conversion to an arithmetic or std::optional type.

Enumerator
success 

the conversion succeeded

empty 

the object is missing

failed 

the conversion failed

Function Documentation

◆ access_value() [1/2]

template<class T >
constexpr auto const& reactions::database::access_value ( T const &  c)

Return the underlying value of an object (the same if the object is std::optional)

◆ access_value() [2/2]

template<class T >
constexpr auto const& reactions::database::access_value ( std::optional< T > const &  opt)

Return the underlying value of an object (the same if the object is std::optional)

◆ read_field() [1/2]

template<class Range , class T >
conversion_status reactions::database::read_field ( T &  out,
std::string const &  s 
)

Read a field in a line from a file.

◆ read_field() [2/2]

template<class Ranges , class T >
conversion_status reactions::database::read_field ( value_and_errors< T > &  out,
std::string const &  s 
)

Read a field composed by value and errors in a line from a file.

Variable Documentation

◆ get

template<class F >
constexpr get_t<F> reactions::database::get
static

Accessor to a value/error field.

◆ is_optional_field_v

template<class F >
constexpr auto reactions::database::is_optional_field_v = is_optional_field<F>::value

Contain the information whether a field is optional or not.

◆ is_optional_v

template<class T >
constexpr auto reactions::database::is_optional_v = is_optional<T>::value

Alias to check if a type represents an optional.