Go to the documentation of this file.
9 #include <mrpt/expr/CRuntimeCompiledExpression.h>
26 std::optional<mrpt::expr::CRuntimeCompiledExpression>
compiled;
27 std::variant<std::monostate, double*, float*, uint32_t*>
target;
58 const std::vector<std::pair<std::string, double>>& nameValuePairs)
60 for (
const auto& [name, value] : nameValuePairs)
134 template <
typename T>
139 template <
typename T>
143 for (
auto& objPtr : setObjects)
145 auto o = std::dynamic_pointer_cast<Parameterizable>(objPtr);
147 o->attachToParameterSource(source);
159 #define DECLARE_PARAMETER_IN_OPT(__yaml, __variable, __object) \
160 __object.mp2p_icp::Parameterizable::parseAndDeclareParameter( \
161 __yaml.getOrDefault(#__variable, std::to_string(__variable)), \
164 #define DECLARE_PARAMETER_OPT(__yaml, __variable) \
165 DECLARE_PARAMETER_IN_OPT(__yaml, __variable, (*this))
167 #define DECLARE_PARAMETER_IN_REQ(__yaml, __variable, __object) \
168 if (!__yaml.has(#__variable)) \
169 throw std::invalid_argument(mrpt::format( \
170 "Required parameter `%s` not an existing key in dictionary.", \
172 __object.mp2p_icp::Parameterizable::parseAndDeclareParameter( \
173 __yaml[#__variable].as<std::string>(), __variable);
175 #define DECLARE_PARAMETER_REQ(__yaml, __variable) \
176 DECLARE_PARAMETER_IN_REQ(__yaml, __variable, (*this))
ParameterSource * attachedSource_
void checkAllParametersAreRealized() const
const ParameterSource * attachedSource() const
std::string printVariableValues() const
void attach(Parameterizable &obj)
const auto & declaredParameters() const
auto & declaredParameters()
auto getVariableValues() const -> std::map< std::string, double >
void parseAndDeclareParameter_impl(const std::string &value, T &target)
std::variant< std::monostate, double *, float *, uint32_t * > target
void updateVariable(const std::string &variable, double value)
std::set< internal::InfoPerParam * > attachedDeclParameters_
ParameterSource * attachedSource()
ParameterSource()=default
std::optional< mrpt::expr::CRuntimeCompiledExpression > compiled
Compiled expression.
std::map< std::string, double > variables_
void updateVariables(const std::vector< std::pair< std::string, double >> &nameValuePairs)
void parseAndDeclareParameter(const std::string &value, double &target)
virtual void attachToParameterSource(ParameterSource &source)
void unrealizeParameters()
Mark all non-constant parameters as non-evaluated again.
std::vector< internal::InfoPerParam > declParameters_
List of declared parameters:
void AttachToParameterSource(std::vector< std::shared_ptr< T >> &setObjects, ParameterSource &source)
mp2p_icp
Author(s):
autogenerated on Wed Oct 23 2024 02:45:40