1#ifndef PARAMETERMAP_HEADER
2#define PARAMETERMAP_HEADER
16 std::ostream &
operator<<(std::ostream & s, std::vector<double>
const & v);
17 std::ostream &
operator<<(std::ostream & s, std::vector<int>
const & v);
18 std::ostream &
operator<<(std::ostream & s, std::vector<std::string>
const & v);
21 template <
typename T0,
typename... Ts>
22 std::ostream &
operator<<(std::ostream & s, std::variant<T0, Ts...>
const & v) {
23 std::visit([&](
auto && arg) { s << arg; }, v);
31 variant<bool, int, double, std::string, std::vector<int>, std::vector<double>, std::vector<std::string>>;
50 std::map<std::string, ParameterTypes> parameters{};
52 void throw_error(std::string errormessage)
const;
63 auto & x = parameters[rhs];
74 std::map<std::string, ParameterTypes> &
get_map();
83 T
get(std::string
name, T fiducial_value)
const;
std::function< std::string(const RunSettings &)> get
For holding a map of parameters of different types with easy set and gets allowing for fiducial value...
ParameterMap & operator=(const ParameterMap &rhs)=default
ParameterMap & operator=(ParameterMap &&other)=default
std::map< std::string, ParameterTypes > & get_map()
Get a reference to the underlying map.
ParameterMap(const ParameterMap &rhs)=default
void info() const
Show info about the parameter map.
ParameterTypes & operator[](std::string rhs)
bool contains(std::string name) const
Check if a parameter map contains a value.
ParameterMap(ParameterMap &&rhs)=default
std:: variant< bool, int, double, std::string, std::vector< int >, std::vector< double >, std::vector< std::string > > ParameterTypes
All the types we can have in the parameter file: string, int, boolean, double and vectors of double a...
std::ostream & operator<<(std::ostream &s, std::vector< double > const &v)