18 "' cannot be indexed in '" +
28 std::string(s.full_key) +
"'");
35 template <
class T_actual,
class A>
56 auto it = m.find(key);
58 auto keys = std::views::keys(m);
62 "Invalid key '" + std::string(key) +
"' for type '" +
64 "',\n possible keys are: " +
73 requires requires { enum_table<T, ParamString>::table; }
77 auto it = m.find(s.
value);
79 auto vals = std::views::keys(m);
83 "Invalid value '" + std::string(s.
value) +
"' for enum '" +
85 "',\n possible value are: " +
std::string demangled_typename(const std::type_info &t)
Get the pretty name of the given type as a string.
void unsupported_type(T &, ParamString s)
Throw a meaningful error to indicate that parameters of type T are not supported or implemented.
std::string_view key
The subkey to resolve next.
void assert_key_empty(ParamString s)
Throw a meaningful error when s.key is not empty, to indicate that the given type T is not of struct ...
std::string_view full_key
Full key string, used for diagnostics.
auto split_key(std::string_view full, char tok='.')
Split the string full on the first occurrence of tok.
std::string_view value
The value of the parameter to store.
void set_param(T &t, const json &j)
Update/overwrite the first argument based on the JSON object j.
Represents a parameter value encoded as a string in the format abc.def.key=value.
Function wrapper to set attributes of a struct, type-erasing the type of the attribute.
Specialize this type to define the attribute name to attribute setters dictionaries for a struct type...
Function wrapper access the enumerators of an enum, type-erasing the type of the enum.
Specialize this type to define the enumerator name to value dictionaries for an enum type T.
std::string join(std::ranges::input_range auto strings, join_opt opt={})
Join the list of strings into a single string, using the separator given by opt.
void sort_case_insensitive(auto &range)
Sort the given range of strings in-place in a case-insensitive manner.
EigenConfigd DefaultConfig
attribute_accessor(A T_actual::*attr, std::string_view="")
std::function< void(T &, const ParamString &)> set
enum_accessor(T value, std::string_view="")
Custom parameter parsing exception.