10 std::optional<ParameterType> pt = this->get_proxy(block,
id);
12 if (!pt.has_value()) {
16 return std::optional<double>(this->types_p[pt.value()](block,
id));
20 std::optional<ParameterType> pt = this->get_proxy(block,
id);
22 if (!pt.has_value()) {
23 LOG_ERROR(
"ValueError",
"Cannot set a parameter :", block,
id,
"that does not exist.");
29std::optional<ParameterType> UserParameterProxy::get_proxy(std::string block,
LhaID id) {
30 for (
auto p : this->types_p) {
31 if (p.second.exists(block,
id)) {
32 return std::optional<ParameterType>(p.first);
#define LOG_ERROR(type,...)
Macro for logging error messages and terminating the application.
Provides access to parameter values, errors, and existence checks.
Concrete mutator that directly sets the value of parameters.
void mutate(const ParamId &pid, scalar_t value) override
Sets the value of a parameter.
std::optional< double > get_value(std::string block, LhaID id) override
void set_value(std::string block, LhaID id, double val) override
UserParameterProxy(std::vector< ParameterType > types)
Represents an identifier of a LHA element, possibly containing several sub-ids.