CepGen 1.2.5
Central exclusive processes event generator
|
A generic factory to build modules. More...
#include <CepGen/Modules/ModuleFactory.h>
Public Types | |
typedef std::unique_ptr< T >(* | Builder) (const ParametersList &) |
Constructor type for a module. | |
Public Member Functions | |
ModuleFactory (const ModuleFactory &)=delete | |
Disabled copy constructor. | |
virtual | ~ModuleFactory ()=default |
Default destructor. | |
void | operator= (const ModuleFactory &)=delete |
Disabled assignment operator. | |
const std::string & | description () const |
Describe the modules factory. | |
template<typename U > | |
void | registerModule (const std::string &name, const ParametersList &def_params=ParametersList()) |
Register a named module in the database. | |
std::unique_ptr< T > | build (const ParametersList &) const |
Build one instance of a named module. | |
std::unique_ptr< T > | build (const std::string &name, const ParametersList ¶ms=ParametersList()) const |
Build one instance of a named module. | |
std::unique_ptr< T > | build (int index, const ParametersList ¶ms=ParametersList()) const |
Build one instance of a named module. | |
std::string | describe (const std::string &name) const |
Describe one named module Describe the parameters of one named module. | |
ParametersDescription | describeParameters (const ParametersList &) const |
ParametersDescription | describeParameters (const std::string &name, const ParametersList ¶ms=ParametersList()) const |
Describe the parameters of one named module. | |
ParametersDescription | describeParameters (int index, const ParametersList ¶ms=ParametersList()) const |
Describe the parameters of one named module. | |
std::vector< std::string > | modules () const |
List of modules registred in the database. | |
bool | empty () const |
Is the database empty? | |
size_t | size () const |
Number of modules registered in the database. | |
const std::unordered_map< int, std::string > & | indices () const |
bool | has (const std::string &name) const |
Check if a named module is registered. | |
ModuleFactory (const std::string &desc) | |
std::vector< std::string > | modules () const |
std::unique_ptr< MadGraphProcess > | build (const std::string &mod_name, const ParametersList ¶ms) const |
Protected Member Functions | |
ModuleFactory (const std::string &) | |
Hidden default constructor for singleton operations. | |
Protected Attributes | |
std::unordered_map< int, std::string > | indices_ |
Index-to-map association map. | |
T | Base class to build |
Definition at line 48 of file ModuleFactory.h.
typedef std::unique_ptr< T >(* Builder) (const ParametersList &) |
Definition at line 87 of file ModuleFactory.h.
|
delete |
|
virtualdefault |
|
explicitprotected |
Definition at line 26 of file ModuleFactory.cpp.
ModuleFactory | ( | const std::string & | desc | ) |
Definition at line 27 of file MadGraphProcessFactory.cpp.
std::unique_ptr< T > build | ( | const ParametersList & | params | ) | const |
[in] | params | List of parameters to be invoked by the constructor |
Definition at line 29 of file ModuleFactory.cpp.
std::unique_ptr< MadGraphProcess > build | ( | const std::string & | mod_name, |
const ParametersList & | params | ||
) | const |
Definition at line 38 of file MadGraphProcessFactory.cpp.
std::unique_ptr< T > build | ( | const std::string & | name, |
const ParametersList & | params = ParametersList() |
||
) | const |
[in] | name | Module name to retrieve |
[in] | params | List of parameters to be invoked by the constructor |
Definition at line 51 of file ModuleFactory.cpp.
std::unique_ptr< T > build | ( | int | index, |
const ParametersList & | params = ParametersList() |
||
) | const |
[in] | index | Module index (if found) to retrieve |
[in] | params | List of parameters to be invoked by the constructor |
Definition at line 65 of file ModuleFactory.cpp.
std::string describe | ( | const std::string & | name | ) | const |
[in] | params | Parameters (incl. the name) to steer the description |
Definition at line 77 of file ModuleFactory.cpp.
ParametersDescription describeParameters | ( | const ParametersList & | params | ) | const |
Definition at line 82 of file ModuleFactory.cpp.
ParametersDescription describeParameters | ( | const std::string & | name, |
const ParametersList & | params = ParametersList() |
||
) | const |
[in] | name | Name of the module to describe |
[in] | params | Additional parameters to steer the description |
Definition at line 96 of file ModuleFactory.cpp.
ParametersDescription describeParameters | ( | int | index, |
const ParametersList & | params = ParametersList() |
||
) | const |
[in] | index | Index of the module to describe |
[in] | params | Additional parameters to steer the description |
Definition at line 111 of file ModuleFactory.cpp.
const std::string & description | ( | ) | const |
Definition at line 54 of file ModuleFactory.h.
bool empty | ( | ) | const |
Definition at line 104 of file ModuleFactory.h.
bool has | ( | const std::string & | name | ) | const |
Definition at line 109 of file ModuleFactory.h.
const std::unordered_map< int, std::string > & indices | ( | ) | const |
Definition at line 106 of file ModuleFactory.h.
std::vector< std::string > modules |
Definition at line 123 of file ModuleFactory.cpp.
std::vector< std::string > modules | ( | ) | const |
Definition at line 30 of file MadGraphProcessFactory.cpp.
|
delete |
void registerModule | ( | const std::string & | name, |
const ParametersList & | def_params = ParametersList() |
||
) |
U | Class to register (inherited from T base class) |
Definition at line 59 of file ModuleFactory.h.
size_t size | ( | ) | const |
List of index-to-string associations in the database
Definition at line 105 of file ModuleFactory.h.
|
protected |
Definition at line 124 of file ModuleFactory.h.