cepgen is hosted by Hepforge, IPPP Durham
CepGen 1.2.3
A generic central exclusive processes event generator
Loading...
Searching...
No Matches
ParametersList Class Reference

#include <CepGen/Core/ParametersList.h>

+ Inheritance diagram for ParametersList:

Public Member Functions

 ParametersList ()=default
 
 ParametersList (const ParametersList &)
 Copy constructor.
 
 ~ParametersList ()
 
ParametersListoperator= (const ParametersList &)=default
 Assignment operator.
 
bool hasName () const
 Does the parameters list have a name key?
 
std::string name (const std::string &def="") const
 Retrieve the module name if any.
 
ParametersListsetName (const std::string &)
 Set the module name.
 
bool operator== (const ParametersList &) const
 Equality operator.
 
bool operator!= (const ParametersList &oth) const
 Inequality operator.
 
ParametersList diff (const ParametersList &) const
 Diff with another parameters list ('mine' + 'theirs' keys)
 
ParametersListfeed (const std::string &)
 Feed a control string to the list of parameters.
 
template<typename T >
bool has (const std::string &key) const
 Check if a given parameter is handled in this list.
 
size_t erase (const std::string &)
 Erase a parameter with key.
 
template<typename T >
size_t erase (const std::string &)
 Erase a typed parameter with key.
 
template<typename T >
const ParametersListfill (const std::string &key, T &value) const
 Fill a variable with the key content if exists.
 
template<typename T >
get (const std::string &key, const T &def=default_arg< T >::get()) const
 Get a parameter value.
 
template<typename T , typename U >
U getAs (const std::string &key, const U &def=default_arg< U >::get()) const
 Get a recast parameter value.
 
template<typename T >
T & operator[] (const std::string &key)
 Reference to a parameter value.
 
template<typename T >
ParametersListset (const std::string &, const T &)
 Set a parameter value Set a recast parameter value.
 
template<typename T , typename U >
ParametersListsetAs (const std::string &key, const U &value)
 
ParametersListrename (const std::string &, const std::string &)
 Rename the key to a parameter value.
 
ParametersListoperator+= (const ParametersList &oth)
 Concatenate two parameters containers.
 
ParametersList operator+ (const ParametersList &oth) const
 Concatenation of two parameters containers.
 
bool empty () const
 Is the list empty?
 
template<typename T >
std::vector< std::string > keysOf () const
 List of keys for one type in this list of parameters List of keys handled in this list of parameters.
 
std::vector< std::string > keys (bool name_key=true) const
 
std::string getString (const std::string &key, bool wrap=false) const
 Get a string-converted version of a value.
 
std::string getNameString (bool wrap=false) const
 Get a string-converted version of the module name if any.
 
std::string serialise () const
 Serialise a parameters collection into a parseable string.
 
const ParametersListprint (std::ostream &) const
 Debugging-like printout of a parameters container.
 
std::string print (bool compact=false) const
 Normal printout of a parameters container.
 
template<>
Limits get (const std::string &key, const Limits &def) const
 
template<>
const ParametersListfill (const std::string &key, Limits &value) const
 
template<>
bool has (const std::string &key) const
 Check if a particle properties object is handled.
 
template<>
ParticleProperties get (const std::string &key, const ParticleProperties &def) const
 Get a particle properties object.
 
template<>
ParametersListset (const std::string &key, const ParticleProperties &value)
 Set a particle properties object value.
 
template<>
std::vector< std::string > keysOf () const
 

Friends

std::ostream & operator<< (std::ostream &, const ParametersList &)
 Human-readable version of a parameters container.
 

Detailed Description

Definition at line 52 of file ParametersList.h.

Constructor & Destructor Documentation

◆ ParametersList() [1/2]

ParametersList ( )
default

◆ ParametersList() [2/2]

ParametersList ( const ParametersList oth)

Definition at line 71 of file ParametersList.cpp.

◆ ~ParametersList()

Definition at line 63 of file ParametersList.h.

Member Function Documentation

◆ diff()

ParametersList diff ( const ParametersList oth) const

Definition at line 82 of file ParametersList.cpp.

◆ empty()

bool empty ( ) const

Definition at line 249 of file ParametersList.cpp.

◆ erase() [1/2]

size_t erase ( const std::string &  key)
Returns
Number of key-indexed values erased

Definition at line 241 of file ParametersList.cpp.

◆ erase() [2/2]

template<typename T >
size_t erase ( const std::string &  )
Returns
Number of key-indexed values erased

◆ feed()

ParametersList & feed ( const std::string &  raw_args)

Definition at line 161 of file ParametersList.cpp.

◆ fill() [1/2]

template<>
const ParametersList & fill ( const std::string &  key,
Limits value 
) const

Definition at line 452 of file ParametersList.cpp.

◆ fill() [2/2]

template<typename T >
const ParametersList & fill ( const std::string &  key,
T &  value 
) const
Parameters
[in]keyUnique key for parameter
[out]valueObject/variable to be filled with parameter value

Definition at line 92 of file ParametersList.h.

◆ get() [1/3]

template<>
Limits get ( const std::string &  key,
const Limits def 
) const

Definition at line 434 of file ParametersList.cpp.

◆ get() [2/3]

template<>
ParticleProperties get ( const std::string &  key,
const ParticleProperties def 
) const

Definition at line 481 of file ParametersList.cpp.

◆ get() [3/3]

template<typename T >
T get ( const std::string &  key,
const T &  def = default_arg<T>::get() 
) const
Parameters
[in]keyUnique key for parameter
[in]defDefault parameters value if parameter is not contained

Definition at line 396 of file ParametersList.cpp.

◆ getAs()

template<typename T , typename U >
U getAs ( const std::string &  key,
const U def = default_arg<U>::get() 
) const
Template Parameters
TBase type of the parameter
UType to recast the parameter into
Parameters
[in]keyUnique key for parameter
[in]defDefault parameters value if parameter is not contained

Definition at line 108 of file ParametersList.h.

◆ getNameString()

std::string getNameString ( bool  wrap = false) const
Parameters
[in]wrapEncapsulate the value with type()

Definition at line 142 of file ParametersList.h.

◆ getString()

std::string getString ( const std::string &  key,
bool  wrap = false 
) const
Parameters
[in]keyUnique key for parameter
[in]wrapEncapsulate the value with type()

Definition at line 313 of file ParametersList.cpp.

◆ has() [1/2]

template<>
bool has ( const std::string &  key) const

Definition at line 475 of file ParametersList.cpp.

◆ has() [2/2]

template<typename T >
bool has ( const std::string &  key) const
Parameters
keyUnique key for parameter

Definition at line 391 of file ParametersList.cpp.

◆ hasName()

bool hasName ( ) const

Definition at line 292 of file ParametersList.cpp.

◆ keys()

std::vector< std::string > keys ( bool  name_key = true) const

Definition at line 298 of file ParametersList.cpp.

◆ keysOf() [1/2]

template<>
std::vector< std::string > keysOf ( ) const

Definition at line 503 of file ParametersList.cpp.

◆ keysOf() [2/2]

template<typename T >
std::vector< std::string > keysOf ( ) const
Parameters
[in]name_keyInclude the name variable?

◆ name()

std::string name ( const std::string &  def = "") const

Definition at line 294 of file ParametersList.cpp.

◆ operator!=()

bool operator!= ( const ParametersList oth) const

Definition at line 71 of file ParametersList.h.

◆ operator+()

ParametersList operator+ ( const ParametersList oth) const

Definition at line 155 of file ParametersList.cpp.

◆ operator+=()

ParametersList & operator+= ( const ParametersList oth)

Definition at line 111 of file ParametersList.cpp.

◆ operator=()

ParametersList & operator= ( const ParametersList )
default

◆ operator==()

bool operator== ( const ParametersList oth) const

Definition at line 73 of file ParametersList.cpp.

◆ operator[]()

template<typename T >
T & operator[] ( const std::string &  key)
Parameters
[in]keyUnique key for parameter

Definition at line 401 of file ParametersList.cpp.

◆ print() [1/2]

std::string print ( bool  compact = false) const

Definition at line 276 of file ParametersList.cpp.

◆ print() [2/2]

const ParametersList & print ( std::ostream &  os) const

Definition at line 256 of file ParametersList.cpp.

◆ rename()

ParametersList & rename ( const std::string &  old_key,
const std::string &  new_key 
)

Definition at line 357 of file ParametersList.cpp.

◆ serialise()

std::string serialise ( ) const

Definition at line 366 of file ParametersList.cpp.

◆ set() [1/2]

template<typename T >
ParametersList & set ( const std::string &  key,
const T &   
)
Template Parameters
TBase type of the parameter
UType to recast the parameter into
Parameters
[in]keyUnique key for parameter
[in]valueValue to set the parameter

Definition at line 406 of file ParametersList.cpp.

◆ set() [2/2]

template<>
ParametersList & set ( const std::string &  key,
const ParticleProperties value 
)

Definition at line 503 of file ParametersList.cpp.

◆ setAs()

template<typename T , typename U >
ParametersList & setAs ( const std::string &  key,
const U value 
)

Definition at line 123 of file ParametersList.h.

◆ setName()

ParametersList & setName ( const std::string &  value)

Definition at line 296 of file ParametersList.cpp.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const ParametersList params 
)
friend

Definition at line 251 of file ParametersList.cpp.