Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
qcdorder_ids.hpp
Go to the documentation of this file.
1#ifndef QCD_ORDER_IDS_H
2#define QCD_ORDER_IDS_H
3
4#include "generic_mapper.h"
5#include "Map.h"
6
14struct QCDOrderTag {};
16
18: public GenericMapperNoExt<QCDOrderTag, QCDOrder, order_mapping>
19{
20public:
22
23 using Base::str;
24 using Base::id_of;
25 using Base::to_id;
26 using Base::enum_of;
27 using Base::list_all;
29
34 static QCDOrder enum_elt(std::string_view s) {
35 const auto key = normalize_key(s);
36 for (const auto& [e, name] : order_mapping()) {
37 if (normalize_key(name) == key) return e;
38 }
39 throw std::out_of_range("Unknown QCD order: " + std::string(s));
40 }
41};
42
43#endif
QCDOrder
const std::map< QCDOrder, std::string > & order_mapping()
Returns the mapping between QCDOrder and its string representation.
Definition Map.cpp:1113
Static mappings between enum classes and string (or FLHA) identifiers.
Generic enum↔string mapper without external keys.
static void init_builtins()
Explicitly initializes builtin entries.
static IdOf< QCDOrderTag > id_of(std::string_view s)
Resolves a string into an IdOf<Tag> via the registry.
static std::vector< IdOf< QCDOrderTag > > list_all()
Lists all distinct IdOf<Tag> entries in the registry.
static std::string str(const IdOf< QCDOrderTag > &id)
Returns the string representation associated with an identifier.
static std::optional< QCDOrder > enum_of(const IdOf< QCDOrderTag > &id)
Attempts to recover the enum value associated with an identifier.
static IdOf< QCDOrderTag > to_id(QCDOrder e)
Converts an enum value to an IdOf<Tag>.
static QCDOrder enum_elt(std::string_view s)
Legacy lookup: converts a string into a QCDOrder enum. Performs a case-insensitive search over the bu...
Returns an uppercase copy of the input string.
std::string normalize_key(std::string_view s)
Normalizes a string key in a case-insensitive manner.
Generic enum↔string (and optional external key) mappers built on DynamicRegistry.