cepgen is hosted by Hepforge, IPPP Durham
CepGen 1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
ParametersList.cpp File Reference
#include <iomanip>
#include <limits>
#include <regex>
#include "CepGen/Core/Exception.h"
#include "CepGen/Core/ParametersList.h"
#include "CepGen/Physics/PDG.h"
#include "CepGen/Utils/String.h"
+ Include dependency graph for ParametersList.cpp:

Go to the source code of this file.

Namespaces

namespace  cepgen
 Common namespace for this Monte Carlo generator.
 

Macros

#define IMPL_TYPE_GET(type, coll)
 
#define IMPL_TYPE_SET(type, coll)
 
#define IMPL_TYPE_ALL(type, coll)
 
#define __TYPE_ENUM(type, map, name)
 
#define __TYPE_ENUM(type, map, name)
 
#define __TYPE_ENUM(type, map, name)   map.insert(oth.map.begin(), oth.map.end());
 
#define __TYPE_ENUM(type, map, name)   num_keys_erased += erase<type>(key);
 
#define __TYPE_ENUM(type, map, name)   std::transform(map.begin(), map.end(), std::back_inserter(out), key);
 
#define __TYPE_ENUM(type, map, name)
 
#define __TYPE_ENUM(type, map, name)
 

Functions

std::ostream & operator<< (std::ostream &os, const ParametersList &params)
 
 IMPL_TYPE_ALL (ParametersList, param_values_)
 
 IMPL_TYPE_ALL (bool, bool_values_)
 
 IMPL_TYPE_ALL (int, int_values_)
 
 IMPL_TYPE_ALL (unsigned long long, ulong_values_)
 
 IMPL_TYPE_ALL (double, dbl_values_)
 
 IMPL_TYPE_ALL (std::string, str_values_)
 
 IMPL_TYPE_ALL (std::vector< int >, vec_int_values_)
 
 IMPL_TYPE_ALL (std::vector< double >, vec_dbl_values_)
 
 IMPL_TYPE_ALL (std::vector< std::string >, vec_str_values_)
 
 IMPL_TYPE_ALL (std::vector< Limits >, vec_lim_values_)
 
 IMPL_TYPE_ALL (std::vector< ParametersList >, vec_param_values_)
 
 IMPL_TYPE_ALL (std::vector< std::vector< double > >, vec_vec_dbl_values_)
 
 IMPL_TYPE_SET (Limits, lim_values_)
 

Macro Definition Documentation

◆ __TYPE_ENUM [1/7]

#define __TYPE_ENUM (   type,
  map,
  name 
)
Value:
if (map != oth.map) \
return false;

◆ __TYPE_ENUM [2/7]

#define __TYPE_ENUM (   type,
  map,
  name 
)
Value:
if (const auto my_param = get<type>(key), their_param = oth.get<type>(key); my_param != their_param) { \
mine.set(key, my_param); \
if (!oth.empty()) \
theirs.set(key, their_param); \
continue; \
}

◆ __TYPE_ENUM [3/7]

#define __TYPE_ENUM (   type,
  map,
  name 
)    map.insert(oth.map.begin(), oth.map.end());

◆ __TYPE_ENUM [4/7]

#define __TYPE_ENUM (   type,
  map,
  name 
)    num_keys_erased += erase<type>(key);

◆ __TYPE_ENUM [5/7]

#define __TYPE_ENUM (   type,
  map,
  name 
)    std::transform(map.begin(), map.end(), std::back_inserter(out), key);

◆ __TYPE_ENUM [6/7]

#define __TYPE_ENUM (   type,
  map,
  name 
)
Value:
if (has<type>(key)) \
return wrap_val(get<type>(key), name);

◆ __TYPE_ENUM [7/7]

#define __TYPE_ENUM (   type,
  map,
  name 
)
Value:
if (has<type>(old_key)) \
set(new_key, get<type>(old_key)).erase(old_key);

◆ IMPL_TYPE_ALL

#define IMPL_TYPE_ALL (   type,
  coll 
)
Value:
IMPL_TYPE_GET(type, coll); \
IMPL_TYPE_SET(type, coll); \
static_assert(true, "")
#define IMPL_TYPE_GET(type, coll)

Definition at line 65 of file ParametersList.cpp.

◆ IMPL_TYPE_GET

#define IMPL_TYPE_GET (   type,
  coll 
)
Value:
template <> \
type ParametersList::get<type>(const std::string& key, const type& def) const { \
if (coll.count(key) > 0) \
return coll.at(key); \
CG_DEBUG("ParametersList") << "Failed to retrieve " << utils::demangle(typeid(type).name()) \
<< " parameter with key=" << key << ". Default value: " << def << "."; \
return def; \
} \
static_assert(true, "")

Definition at line 28 of file ParametersList.cpp.

◆ IMPL_TYPE_SET

#define IMPL_TYPE_SET (   type,
  coll 
)
Value:
template <> \
bool ParametersList::has<type>(const std::string& key) const { \
return coll.count(key) != 0; \
} \
template <> \
ParametersList& ParametersList::set<type>(const std::string& key, const type& value) { \
coll[key] = static_cast<type>(value); \
return *this; \
} \
template <> \
type& ParametersList::operator[]<type>(const std::string& key) { \
return coll[key]; \
} \
template <> \
std::vector<std::string> ParametersList::keysOf<type>() const { \
std::vector<std::string> out; \
std::transform(coll.begin(), coll.end(), std::back_inserter(out), [](const auto& pair) { return pair.first; }); \
return out; \
} \
template <> \
size_t ParametersList::erase<type>(const std::string& key) { \
return coll.erase(key); \
} \
static_assert(true, "")

Definition at line 39 of file ParametersList.cpp.