10#include <framework/core/ModuleParam.h>
12#include <boost/variant/variant.hpp>
23 class ModuleParamList;
25 namespace TrackFindingCDC {
28 using ParameterVariant =
29 boost::variant<bool, int, double, std::string, std::vector<double>, std::vector<std::string>>;
32 using ParameterVariantMap = std::map<std::string, ParameterVariant>;
38 template <
class ... T>
40 const std::map<std::string, boost::variant<T...> >& valuesByName)
42 for (
auto& nameAndValue : valuesByName) {
43 const std::string& name = nameAndValue.first;
44 const boost::variant<T...>& value = nameAndValue.second;
46 boost::apply_visitor(visitor, value);
The Module parameter list class.
A single parameter of the module.
Abstract base class for different kinds of events.
A helper class to unpack a boost::variant parameter value and set it in the parameter list.
void operator()(const T &t) const
Function call that receives the parameter value from the boost::variant with the correct type.
ModuleParamList * m_moduleParamList
Parameter list which contains the parameter to be set.
std::string m_paramName
Name of the parameter to be set.
static void update(ModuleParamList *moduleParamList, const std::map< std::string, boost::variant< T... > > &valuesByName)
Transfer all the parameters from the map boost:variant values to the module parameter list.