ATLAS Offline Software
Loading...
Searching...
No Matches
SpecRegistry.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3 */
4#ifndef GLOBALSIM_SPECREGISTRY_H
5#define GLOBALSIM_SPECREGISTRY_H
6
7/*
8 The BitSpecs that can be read from and written to hex text, looked up by name.
9
10 TOBTextReader and TOBTextWriter both take a BitSpec property and find their
11 entry here, so a TOB type is listed once and becomes usable in both
12 directions at the same time. Adding one is a single line in SpecRegistry.cxx.
13
14 Keeping the layout behind a std::function means neither algorithm is a class
15 template: there is one component per algorithm however many specs exist, and
16 the spec is chosen at configuration time rather than at compile time.
17*/
18
20
21#include <cstddef>
22#include <functional>
23#include <map>
24#include <string>
25
26namespace GlobalSim {
27
28 struct SpecEntry {
31 std::size_t width{0};
32
34 std::function<std::string(const SG::AuxElement&)> pack;
35
39 std::function<void(SG::AuxElement&, const std::string&)> unpack;
40 };
41
43 const std::map<std::string, SpecEntry>& specRegistry();
44
46 std::string knownSpecNames();
47
48}
49
50#endif // GLOBALSIM_SPECREGISTRY_H
Base class for elements of a container that can have aux data.
AlgTool to read in LArStripNeighborhoods, and run the BDT Algorithm.
Definition BitSpec.h:23
std::string knownSpecNames()
Comma-separated list of the known names, for error messages.
const std::map< std::string, SpecEntry > & specRegistry()
The known specs, by name. Built on first use.
AuxElement(SG::AuxVectorData *container, size_t index)
Base class for elements of a container that can have aux data.
std::size_t width
Total width of the packed word, in bits.
std::function< void(SG::AuxElement &, const std::string &)> unpack
Fill one object from its hex token.
std::function< std::string(const SG::AuxElement &)> pack
Pack one object into its hex token.