CMS 3D CMS Logo

ELmap.h
Go to the documentation of this file.
1 #ifndef MessageLogger_ELmap_h
2 #define MessageLogger_ELmap_h
3 
4 // ----------------------------------------------------------------------
5 //
6 // ELmap.h Provides a map class with the semantics of std::map.
7 // Customizers may substitute for this class to provide either
8 // a map with a different allocator, or whatever else.
9 //
10 // We typedef an individual type for each of these maps since
11 // the syntax
12 // typedef map ELmap;
13 // ELlist<ELextededID, Counts, ELextendedID::less> table;
14 // may or may not be valid C++, and if valid probably won't work
15 // everywhere.
16 //
17 // The key types are common enough types (strings and extended id's);
18 // the data types are peculiar to each type of map. We have made the
19 // design choice of grouping all maps in this one file, so that if
20 // a customizer needs to do something else with maps, all the slop is
21 // in one place.
22 //
23 // The drawback is that all the classes that depend on these maps must
24 // include ELmap.h, which pulls in not only the maps and structs they
25 // need but those anybody else needs. Fortunately, only two classes
26 // use maps at all: ELlimitsTable and the ELstatistics destination.
27 // So this drawback is very slight.
28 //
29 // The elements of map semantics which ErrorLogger code rely upon are
30 // listed in ELmap.semantics.
31 //
32 // ----------------------------------------------------------------------
33 
34 #include <map>
35 #include <string>
36 
38 
39 namespace edm {
40 
41  // ----------------------------------------------------------------------
42 
44  public:
45  int limit;
46  int timespan;
47  int interval;
48 
49  LimitAndTimespan(int lim = -1, int ts = -1, int ivl = -1);
50 
51  }; // LimitAndTimespan
52 
53  class CountAndLimit {
54  public:
55  int n;
57  time_t lastTime;
58  int limit;
59  int timespan;
60  int interval;
61  int skipped;
62 
63  CountAndLimit(int lim = -1, int ts = -1, int ivl = -1);
64  bool add();
65 
66  }; // CountAndLimit
67 
68  class StatsCount {
69  public:
70  int n;
76 
77  StatsCount();
78  void add(std::string_view context, bool reactedTo);
79 
80  }; // StatsCount
81 
82  // ----------------------------------------------------------------------
83 
84  typedef std::map<std::string, LimitAndTimespan> ELmap_limits;
85 
86  typedef std::map<ELextendedID, CountAndLimit> ELmap_counts;
87 
88  typedef std::map<ELextendedID, StatsCount> ELmap_stats;
89 
90  // See ELseverityLevel.cc for another map: ELmap_sevTran
91 
92  // ----------------------------------------------------------------------
93 
94 } // end of namespace edm
95 
96 #endif // MessageLogger_ELmap_h
edm::LimitAndTimespan::LimitAndTimespan
LimitAndTimespan(int lim=-1, int ts=-1, int ivl=-1)
Definition: ELmap.cc:32
edm::CountAndLimit::CountAndLimit
CountAndLimit(int lim=-1, int ts=-1, int ivl=-1)
Definition: ELmap.cc:38
edm::LimitAndTimespan::timespan
int timespan
Definition: ELmap.h:46
ELextendedID.h
edm::ELmap_counts
std::map< ELextendedID, CountAndLimit > ELmap_counts
Definition: ELmap.h:86
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::CountAndLimit::interval
int interval
Definition: ELmap.h:60
edm::StatsCount::context2
std::string context2
Definition: ELmap.h:74
edm::ELmap_limits
std::map< std::string, LimitAndTimespan > ELmap_limits
Definition: ELmap.h:84
edm::CountAndLimit::timespan
int timespan
Definition: ELmap.h:59
edm::LimitAndTimespan::limit
int limit
Definition: ELmap.h:45
edm::ELmap_stats
std::map< ELextendedID, StatsCount > ELmap_stats
Definition: ELmap.h:88
visDQMUpload.context
context
Definition: visDQMUpload.py:37
edm::StatsCount
Definition: ELmap.h:68
edm::StatsCount::n
int n
Definition: ELmap.h:70
edm::LimitAndTimespan
Definition: ELmap.h:43
edm::LimitAndTimespan::interval
int interval
Definition: ELmap.h:47
edm::StatsCount::aggregateN
int aggregateN
Definition: ELmap.h:71
edm::CountAndLimit
Definition: ELmap.h:53
edm::CountAndLimit::add
bool add()
Definition: ELmap.cc:48
edm::CountAndLimit::skipped
int skipped
Definition: ELmap.h:61
edm::CountAndLimit::n
int n
Definition: ELmap.h:55
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::StatsCount::contextLast
std::string contextLast
Definition: ELmap.h:75
edm::CountAndLimit::limit
int limit
Definition: ELmap.h:58
edm::CountAndLimit::aggregateN
int aggregateN
Definition: ELmap.h:56
edm::StatsCount::StatsCount
StatsCount()
Definition: ELmap.cc:117
edm::StatsCount::context1
std::string context1
Definition: ELmap.h:73
edm::StatsCount::add
void add(std::string_view context, bool reactedTo)
Definition: ELmap.cc:119
edm::StatsCount::ignoredFlag
bool ignoredFlag
Definition: ELmap.h:72
edm::CountAndLimit::lastTime
time_t lastTime
Definition: ELmap.h:57