Belle II Software development
FilterParamMap Class Reference

Variant of types allowed to be forwarded to a filter selected at runtime. More...

#include <FilterParamMap.h>

Classes

class  Impl
 Define the implementation. More...
 

Public Member Functions

 FilterParamMap ()
 Default constructor.
 
 ~FilterParamMap ()
 Default destructor.
 
void addParameter (ModuleParamList *moduleParamList, const std::string &name, const std::string &description)
 Create one parameter in the parameter list for the module with the given name and desciption.
 
void assignTo (ModuleParamList *filterModuleParamList)
 Unpack the map of parameters and forward them to the concrete filter.
 

Private Attributes

std::unique_ptr< Implm_impl
 Pointer to implementation hiding the details.
 

Detailed Description

Variant of types allowed to be forwarded to a filter selected at runtime.

Facade for a map of parameters that should be forwarded to a filter selected at runtime.

This class provides an intermediate space for a map of parameters from the steering that wait to be assigned to a concrete filter instance also selected in the steering. To achieve this it uses a map of strings to a variant such that it is able to forward parameters of different types to the filter in a type-safe way.

The present implementation now uses the PImpl idiom to hide the bulk of internal details of boost::variant from all the users, which reduced the compilation time by a good 20%.

The parameters can still be inspected by getValues(), but the user must include the implementation (e.g. "#include <boost/variant/variant.hpp>") to be able to inspect them.

Definition at line 41 of file FilterParamMap.h.

Constructor & Destructor Documentation

◆ FilterParamMap()

Default constructor.

Definition at line 73 of file FilterParamMap.cc.

73 :
74 m_impl(std::make_unique<Impl>())
75{
76}
std::unique_ptr< Impl > m_impl
Pointer to implementation hiding the details.

Member Function Documentation

◆ addParameter()

void addParameter ( ModuleParamList moduleParamList,
const std::string &  name,
const std::string &  description 
)

Create one parameter in the parameter list for the module with the given name and desciption.

Definition at line 81 of file FilterParamMap.cc.

82{
83 m_impl->addParameter(moduleParamList, name, description);
84}

◆ assignTo()

void assignTo ( ModuleParamList filterModuleParamList)

Unpack the map of parameters and forward them to the concrete filter.

Definition at line 87 of file FilterParamMap.cc.

88{
89 m_impl->assignTo(filterModuleParamList);
90};

Member Data Documentation

◆ m_impl

std::unique_ptr<Impl> m_impl
private

Pointer to implementation hiding the details.

Definition at line 65 of file FilterParamMap.h.


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