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();
62 using T = std::decay_t<decltype(arg)>;
64 if constexpr (std::is_same_v<T, std::monostate>)
66 throw std::runtime_error(
67 "[ParameterSource] Attached parameter target is "
70 else if constexpr (std::is_same_v<T, double*>)
74 else if constexpr (std::is_same_v<T, float*>)
76 *arg =
static_cast<float>(val);
78 else if constexpr (std::is_same_v<T, uint32_t*>)
80 *arg =
static_cast<uint32_t
>(val);
85 p->has_been_evaluated =
true;
103 mrpt::expr::CRuntimeCompiledExpression e;
109 target =
static_cast<T
>(e.eval());
112 catch (
const std::exception&)
140 std::stringstream errors;
143 if (p.has_been_evaluated)
continue;
144 errors <<
"- '" << p.expression <<
"'"
148 const auto sErrs = errors.str();
149 if (sErrs.empty())
return;
152 "The following parameter expressions have not been correctly "
161 if (p.is_constant)
continue;
162 p.has_been_evaluated =
false;