A description object for parameters collection. More...
#include <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 &description) |
Set the description of this parameter (or parameters' collection) | |
const std::string & | description () const |
Description of this parameter (or parameters' collection) | |
ParametersDescription & | setParametersVector (bool parameters_vector=true) |
This parameter 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 > &default_values={}) |
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 &, const ParametersDescription &) |
Add the description to a new sub-description (aka ParametersList) object. | |
template<> | |
ParametersDescription & | add (const std::string &, 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. | |
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 types. | |
Definition at line 26 of file ParametersDescription.h.
Enumerator | |
---|---|
Value | |
Parameters | |
Module | |
ParametersVector |
Definition at line 89 of file ParametersDescription.h.
|
explicit |
[in] | mod_key | Module name (where applicable) |
|
explicit |
ParametersDescription & add | ( | const std::string & | , |
const ParametersDescription & | ) |
ParametersDescription & add | ( | const std::string & | , |
const ParametersList & | ) |
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 & | , |
const ParametersDescription & | , | ||
const std::vector< ParametersList > & | default_values = {} ) |
ParametersDescription & allow | ( | const std::string & | , |
const std::string & | = "" ) |
ParametersDescription & allow | ( | int | , |
const std::string & | = "" ) |
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 |
const std::string & description | ( | ) | const |
Definition at line 51 of file ParametersDescription.h.
bool empty | ( | ) | const |
const ParametersDescription & get | ( | const std::string & | ) | const |
const std::string & key | ( | ) | const |
Definition at line 47 of file ParametersDescription.h.
ParametersList & parameters | ( | ) |
const ParametersList & parameters | ( | ) | const |
ParametersDescription & setDescription | ( | const std::string & | description | ) |
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 | parameters_vector = true | ) |
Definition at line 53 of file ParametersDescription.h.
ParametersDescription steer | ( | const ParametersList & | ) | const |
Type type | ( | ) | const |
ParametersList validate | ( | const ParametersList & | ) | const |
|
friend |