CepGen 1.2.5
Central exclusive processes event generator
|
A description object for parameters collection. More...
#include <CepGen/Core/ParametersDescription.h>
Classes | |
class | ParameterValues |
A collection of valid values for a given parameter. More... | |
Public Types | |
enum struct | Type { Value , Parameters , Module , ParametersVector } |
Public Member Functions | |
ParametersDescription (const std::string &mod_key="") | |
Build the description of a parameters collection object. | |
ParametersDescription (const ParametersList ¶ms) | |
Build the (empty) description of a parameters collection object from its definition. | |
bool | empty () const |
Does a description of this parameter (or parameters collection) exist? | |
ParametersDescription & | operator+= (const ParametersDescription &) |
Concatenate another description to this one. | |
template<typename I > | |
ParametersDescription & | setKey (const I &key) |
Set the module name for this parameter (or parameters collection) | |
const std::string & | key () const |
Module name for this parameter. | |
ParametersDescription & | setDescription (const std::string &descr) |
Set the description of this parameter (or parameters collection) | |
const std::string & | description () const |
Description of this parameter (or parameters collection) | |
ParametersDescription & | setParametersVector (bool pv=true) |
This parameters is a collection of sub-parameters. | |
template<typename T > | |
ParametersDescription & | add (const std::string &name, const T &def) |
Add the description to a new parameter. | |
template<typename T , typename U > | |
ParametersDescription & | addAs (const std::string &name, const U &def) |
Add a recast definition to a new parameter. | |
ParametersDescription & | setName (const std::string &name) |
Set the module name. | |
ParametersDescription & | addParametersDescriptionVector (const std::string &, const ParametersDescription &, const std::vector< ParametersList > &def={}) |
Add the description to a collection of ParametersList objects. | |
std::string | describe (size_t offset=0) const |
Human-readable description of parameters and their default value. | |
ParametersList & | parameters () |
List of parameters associated to this description object. | |
const ParametersList & | parameters () const |
List of parameters associated to this description object. | |
bool | has (const std::string &) const |
Ensure the description exists. | |
const ParametersDescription & | get (const std::string &) const |
Get the description of a sub-object. | |
ParametersList | validate (const ParametersList &) const |
Validate a set of used-steered parameters. | |
ParametersDescription | steer (const ParametersList &) const |
Set parameters value for this description object. | |
Type | type () const |
Get the type of parameter considered. | |
const ParameterValues & | allowedValues () const |
Possible values for a parameter. | |
ParametersDescription & | allow (int, const std::string &="") |
Allow an integer value for a parameter. | |
ParametersDescription & | allow (const std::string &, const std::string &="") |
Allow a string value for a parameter. | |
void | allowAll () |
Allow all values to be set for a parameter. | |
template<> | |
ParametersDescription & | add (const std::string &name, const ParametersDescription &desc) |
Add the description to a new sub-description (aka ParametersList) object. | |
template<> | |
ParametersDescription & | add (const std::string &name, const ParametersList &) |
Disable the addition of a ParametersList object to this description. | |
Private Member Functions | |
template<typename T > | |
T | get (const std::string &key, const T &def=default_arg< T >::get()) const |
Get a parameter value. | |
template<> | |
Limits | get (const std::string &key, const Limits &def) const |
template<> | |
ParticleProperties | get (const std::string &key, const ParticleProperties &def) const |
Get a particle properties object. | |
ParametersList & | operator+= (const ParametersList &oth) |
Concatenate two parameters containers. | |
Friends | |
std::ostream & | operator<< (std::ostream &, const ParametersDescription &) |
Human-readable description. | |
std::ostream & | operator<< (std::ostream &, const Type &) |
Human-readable description of parameter type. | |
Definition at line 26 of file ParametersDescription.h.
|
strong |
Enumerator | |
---|---|
Value | |
Parameters | |
Module | |
ParametersVector |
Definition at line 89 of file ParametersDescription.h.
|
explicit |
[in] | mod_key | Module name (where applicable) |
Definition at line 29 of file ParametersDescription.cpp.
|
explicit |
Definition at line 34 of file ParametersDescription.cpp.
ParametersDescription & add | ( | const std::string & | name, |
const ParametersDescription & | desc | ||
) |
Definition at line 173 of file ParametersDescription.cpp.
ParametersDescription & add | ( | const std::string & | name, |
const ParametersList & | |||
) |
Definition at line 189 of file ParametersDescription.cpp.
ParametersDescription & add | ( | const std::string & | name, |
const T & | def | ||
) |
Definition at line 59 of file ParametersDescription.h.
ParametersDescription & addAs | ( | const std::string & | name, |
const U & | def | ||
) |
Definition at line 69 of file ParametersDescription.h.
ParametersDescription & addParametersDescriptionVector | ( | const std::string & | name, |
const ParametersDescription & | desc, | ||
const std::vector< ParametersList > & | def = {} |
||
) |
Definition at line 195 of file ParametersDescription.cpp.
ParametersDescription & allow | ( | const std::string & | val, |
const std::string & | descr = "" |
||
) |
Definition at line 282 of file ParametersDescription.cpp.
ParametersDescription & allow | ( | int | val, |
const std::string & | descr = "" |
||
) |
Definition at line 276 of file ParametersDescription.cpp.
void allowAll | ( | ) |
Definition at line 120 of file ParametersDescription.h.
const ParameterValues & allowedValues | ( | ) | const |
Definition at line 116 of file ParametersDescription.h.
std::string describe | ( | size_t | offset = 0 | ) | const |
Definition at line 96 of file ParametersDescription.cpp.
const std::string & description | ( | ) | const |
Definition at line 51 of file ParametersDescription.h.
bool empty | ( | ) | const |
Definition at line 48 of file ParametersDescription.cpp.
const ParametersDescription & get | ( | const std::string & | key | ) | const |
Definition at line 74 of file ParametersDescription.cpp.
bool has | ( | const std::string & | key | ) | const |
Definition at line 72 of file ParametersDescription.cpp.
const std::string & key | ( | ) | const |
Definition at line 47 of file ParametersDescription.h.
ParametersDescription & operator+= | ( | const ParametersDescription & | oth | ) |
Definition at line 55 of file ParametersDescription.cpp.
ParametersList & parameters | ( | ) |
Definition at line 216 of file ParametersDescription.cpp.
const ParametersList & parameters | ( | ) | const |
Definition at line 218 of file ParametersDescription.cpp.
ParametersDescription & setDescription | ( | const std::string & | descr | ) |
Definition at line 167 of file ParametersDescription.cpp.
ParametersDescription & setKey | ( | const I & | key | ) |
Definition at line 42 of file ParametersDescription.h.
ParametersDescription & setName | ( | const std::string & | name | ) |
Definition at line 73 of file ParametersDescription.h.
ParametersDescription & setParametersVector | ( | bool | pv = true | ) |
Definition at line 53 of file ParametersDescription.h.
ParametersDescription steer | ( | const ParametersList & | params | ) | const |
Definition at line 264 of file ParametersDescription.cpp.
ParametersDescription::Type type | ( | ) | const |
Definition at line 86 of file ParametersDescription.cpp.
ParametersList validate | ( | const ParametersList & | user_params | ) | const |
Definition at line 220 of file ParametersDescription.cpp.
|
friend |
Definition at line 288 of file ParametersDescription.cpp.
|
friend |
Definition at line 290 of file ParametersDescription.cpp.