cepgen is hosted by Hepforge, IPPP Durham
CepGen N/A
Central exclusive processes event generator

A description object for parameters collection. More...

#include <include/CepGen/Core/ParametersDescription.h>

+ Inheritance diagram for ParametersDescription:
+ Collaboration diagram for ParametersDescription:

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 &params)
 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?
 
ParametersDescriptionoperator+= (const ParametersDescription &)
 Concatenate another description to this one.
 
template<typename I >
ParametersDescriptionsetKey (const I &key)
 Set the module name for this parameter (or parameters' collection)
 
const std::string & key () const
 Module name for this parameter.
 
ParametersDescriptionsetDescription (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)
 
ParametersDescriptionsetParametersVector (bool parameters_vector=true)
 This parameter is a collection of sub-parameters.
 
template<typename T >
ParametersDescriptionadd (const std::string &name, const T &def)
 Add the description to a new parameter.
 
template<typename T , typename U >
ParametersDescriptionaddAs (const std::string &name, const U &def)
 Add a recast definition to a new parameter.
 
ParametersDescriptionsetName (const std::string &name)
 Set the module name.
 
ParametersDescriptionaddParametersDescriptionVector (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.
 
ParametersListparameters ()
 List of parameters associated to this description object.
 
const ParametersListparameters () const
 List of parameters associated to this description object.
 
bool has (const std::string &) const
 Ensure the description exists.
 
const ParametersDescriptionget (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 ParameterValuesallowedValues () const
 Possible values for a parameter.
 
ParametersDescriptionallow (int, const std::string &="")
 Allow an integer value for a parameter.
 
ParametersDescriptionallow (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<>
ParametersDescriptionadd (const std::string &, const ParametersDescription &)
 Add the description to a new sub-description (aka ParametersList) object.
 
template<>
ParametersDescriptionadd (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.
 
ParametersListoperator+= (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.
 

Detailed Description

Definition at line 26 of file ParametersDescription.h.

Member Enumeration Documentation

◆ Type

enum struct Type
strong
Enumerator
Value 
Parameters 
Module 
ParametersVector 

Definition at line 89 of file ParametersDescription.h.

Constructor & Destructor Documentation

◆ ParametersDescription() [1/2]

ParametersDescription ( const std::string & mod_key = "")
explicit
Parameters
[in]mod_keyModule name (where applicable)

◆ ParametersDescription() [2/2]

Member Function Documentation

◆ add() [1/3]

template<>
ParametersDescription & add ( const std::string & ,
const ParametersDescription &  )

◆ add() [2/3]

template<>
ParametersDescription & add ( const std::string & ,
const ParametersList &  )

◆ add() [3/3]

template<typename T >
ParametersDescription & add ( const std::string & name,
const T & def )

Definition at line 59 of file ParametersDescription.h.

◆ addAs()

template<typename T , typename U >
ParametersDescription & addAs ( const std::string & name,
const U & def )

Definition at line 69 of file ParametersDescription.h.

◆ addParametersDescriptionVector()

ParametersDescription & addParametersDescriptionVector ( const std::string & ,
const ParametersDescription & ,
const std::vector< ParametersList > & default_values = {} )

◆ allow() [1/2]

ParametersDescription & allow ( const std::string & ,
const std::string & = "" )

◆ allow() [2/2]

ParametersDescription & allow ( int ,
const std::string & = "" )

◆ allowAll()

void allowAll ( )

Definition at line 120 of file ParametersDescription.h.

◆ allowedValues()

const ParameterValues & allowedValues ( ) const

Definition at line 116 of file ParametersDescription.h.

◆ describe()

std::string describe ( size_t offset = 0) const

◆ description()

const std::string & description ( ) const

Definition at line 51 of file ParametersDescription.h.

◆ empty()

bool empty ( ) const

◆ get()

const ParametersDescription & get ( const std::string & ) const

◆ has()

bool has ( const std::string & ) const

◆ key()

const std::string & key ( ) const

Definition at line 47 of file ParametersDescription.h.

◆ operator+=()

◆ parameters() [1/2]

ParametersList & parameters ( )

◆ parameters() [2/2]

const ParametersList & parameters ( ) const

◆ setDescription()

ParametersDescription & setDescription ( const std::string & description)

◆ setKey()

template<typename I >
ParametersDescription & setKey ( const I & key)

Definition at line 42 of file ParametersDescription.h.

◆ setName()

ParametersDescription & setName ( const std::string & name)

Definition at line 73 of file ParametersDescription.h.

◆ setParametersVector()

ParametersDescription & setParametersVector ( bool parameters_vector = true)

Definition at line 53 of file ParametersDescription.h.

◆ steer()

◆ type()

Type type ( ) const

◆ validate()

ParametersList validate ( const ParametersList & ) const

Friends And Related Symbol Documentation

◆ operator<< [1/2]

std::ostream & operator<< ( std::ostream & ,
const ParametersDescription &  )
friend

◆ operator<< [2/2]

std::ostream & operator<< ( std::ostream & ,
const Type &  )
friend