#include <Counters.h>
Public Member Functions | |
Counters () | |
Build the counters map. | |
virtual align::Counter | get (align::StructureType) const |
Get a counter based on its structure type. | |
virtual | ~Counters () |
Protected Attributes | |
std::map< align::StructureType, align::Counter > | theCounters |
Class to store a list of counters.
A counter is a pointer to a function that returns the number of an alignable based on its id. The number of an alignable is given by its position within its parent. User gets a counter using its structure type via Counters::get(type). Each sub-system has its own concrete counter class implementation.
Definition at line 30 of file Counters.h.
Counters::Counters | ( | ) | [inline] |
virtual Counters::~Counters | ( | ) | [inline, virtual] |
Definition at line 37 of file Counters.h.
{}
Counter Counters::get | ( | align::StructureType | type | ) | const [virtual] |
Get a counter based on its structure type.
Definition at line 8 of file Counters.cc.
References Exception, AlignableObjectId::idToString(), and n.
Referenced by AlignableBuilder::index().
{ auto n = theCounters.find(type); if (theCounters.end() == n) { throw cms::Exception("SetupError") << "Cannot find counter corresponding to the structure " << AlignableObjectId::idToString(type); } return n->second; }
std::map<align::StructureType, align::Counter> Counters::theCounters [protected] |
Definition at line 43 of file Counters.h.