8 #include <mrpt/core/exceptions.h>
30 s += std::to_string(value);
46 if (p->is_constant)
continue;
47 if (p->compiled.has_value())
continue;
49 auto& expr = p->compiled.emplace();
56 if (p->is_constant)
continue;
58 const double val = p->compiled->eval();
63 using T = std::decay_t<decltype(arg)>;
65 if constexpr (std::is_same_v<T, std::monostate>)
67 throw std::runtime_error(
68 "[ParameterSource] Attached parameter target is "
71 else if constexpr (std::is_same_v<T, double*>)
75 else if constexpr (std::is_same_v<T, float*>)
77 *arg =
static_cast<float>(val);
79 else if constexpr (std::is_same_v<T, uint32_t*>)
81 *arg =
static_cast<uint32_t
>(val);
86 p->has_been_evaluated =
true;
103 mrpt::expr::CRuntimeCompiledExpression e;
109 target =
static_cast<T
>(e.eval());
112 catch (
const std::exception&)
137 std::stringstream errors;
140 if (p.has_been_evaluated)
continue;
141 errors <<
"- '" << p.expression <<
"'"
145 const auto sErrs = errors.str();
146 if (sErrs.empty())
return;
149 "The following parameter expressions have not been correctly "
158 if (p.is_constant)
continue;
159 p.has_been_evaluated =
false;