Belle II Software  release-08-01-10
AssignParameterVisitor Struct Reference

A helper class to unpack a boost::variant parameter value and set it in the parameter list. More...

#include <ParameterVariant.h>

Inheritance diagram for AssignParameterVisitor:
Collaboration diagram for AssignParameterVisitor:

Public Member Functions

 AssignParameterVisitor (ModuleParamList *moduleParamList, const std::string &paramName)
 Constructor taking the module parameter list and the name of the parameter to be set from the boost::variant.
 
template<class T >
void operator() (const T &t) const
 Function call that receives the parameter value from the boost::variant with the correct type. More...
 

Static Public Member Functions

template<class ... T>
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 parmeter list.
 

Private Attributes

ModuleParamListm_moduleParamList
 Parameter list which contains the parameter to be set.
 
std::string m_paramName
 Name of the parameter to be set.
 

Detailed Description

A helper class to unpack a boost::variant parameter value and set it in the parameter list.

Definition at line 35 of file ParameterVariant.h.

Member Function Documentation

◆ operator()()

template void operator() ( const T &  t) const

Function call that receives the parameter value from the boost::variant with the correct type.

Assign the value to a keyword in the dictionary.

Definition at line 27 of file ParameterVariant.cc.

28 {
29  B2DEBUG(28, "Received parameter of type " << ModuleParam<T>::TypeInfo());
30  m_moduleParamList->getParameter<T>(m_paramName).setDefaultValue(t);
31 }
A single parameter of the module.
Definition: ModuleParam.h:34
ModuleParam< T > & getParameter(const std::string &name) const
Returns a reference to a parameter.
ModuleParamList * m_moduleParamList
Parameter list which contains the parameter to be set.
std::string m_paramName
Name of the parameter to be set.

The documentation for this struct was generated from the following files: