Lookup of real-valued input parameters.
More...
#include <algorithm>
#include <stdexcept>
#include <string>
#include <unordered_map>
#include <vector>
#include <toml.hpp>
#include "common_typedef.h"
Go to the source code of this file.
|
| struct | InputError |
| | An invalid or missing input value. The message names the key and the offending value; the caller adds the input file name. More...
|
| |
|
| template<typename T > |
| InputError | unknown_option (const std::unordered_map< std::string, T > &options, const std::string &key, const std::string &value) |
| | Error for a value not among the accepted options, listing them.
|
| |
| rtype | as_real (const toml::value &v, const std::string &key) |
| |
| double | as_double (const toml::value &v, const std::string &key) |
| | Double-precision lookups, for inputs of the chemistry (double in every build).
|
| |
| double | find_double (const toml::value &v, const std::string &key) |
| |
| double | find_double_or (const toml::value &v, const std::string &key, const double fallback) |
| |
| rtype | find_real (const toml::value &v, const std::string &key) |
| |
| rtype | find_real (const toml::value &v, const std::string &table, const std::string &key) |
| |
| rtype | find_real_or (const toml::value &v, const std::string &key, const rtype fallback) |
| |
| rtype | find_real_or (const toml::value &v, const std::string &table, const std::string &key, const rtype fallback) |
| |
| std::vector< rtype > | find_real_vector (const toml::value &v, const std::string &key) |
| |
| std::vector< rtype > | find_real_vector (const toml::value &v, const std::string &table, const std::string &key) |
| |
Lookup of real-valued input parameters.
- Author
- Matthew Bonanni (mbona.nosp@m.nni0.nosp@m.01@gm.nosp@m.ail..nosp@m.com)
- Version
- 0.1
- Date
- 2026-10-02
- Copyright
- Copyright (c) 2026 Matthew Bonanni
◆ as_double()
Double-precision lookups, for inputs of the chemistry (double in every build).
◆ as_real()
TOML distinguishes integers from floats, so cfl = 1 is not a float and toml::find_or<double> silently falls back to its default for it. These helpers accept either and reject anything else.
◆ find_double()
◆ find_double_or()
◆ find_real() [1/2]
◆ find_real() [2/2]
◆ find_real_or() [1/2]
◆ find_real_or() [2/2]
◆ find_real_vector() [1/2]
◆ find_real_vector() [2/2]
◆ unknown_option()
Error for a value not among the accepted options, listing them.