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*>) { *arg = val; }
72 else if constexpr (std::is_same_v<T, float*>)
74 *arg =
static_cast<float>(val);
76 else if constexpr (std::is_same_v<T, uint32_t*>)
78 *arg =
static_cast<uint32_t
>(val);
83 p->has_been_evaluated =
true;
101 mrpt::expr::CRuntimeCompiledExpression e;
107 target =
static_cast<T
>(e.eval());
110 catch (
const std::exception&)
138 std::stringstream errors;
141 if (p.has_been_evaluated)
continue;
142 errors <<
"- '" << p.expression <<
"'"
146 const auto sErrs = errors.str();
147 if (sErrs.empty())
return;
150 "The following parameter expressions have not been correctly "
159 if (p.is_constant)
continue;
160 p.has_been_evaluated =
false;