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
std::string context2
Definition: ELmap.h:74
LimitAndTimespan(int lim=-1, int ts=-1, int ivl=-1)
Definition: ELmap.cc:32
CountAndLimit(int lim=-1, int ts=-1, int ivl=-1)
Definition: ELmap.cc:38
int aggregateN
Definition: ELmap.h:71
std::map< std::string, LimitAndTimespan > ELmap_limits
Definition: ELmap.h:84
time_t lastTime
Definition: ELmap.h:57
std::string context1
Definition: ELmap.h:73
std::string contextLast
Definition: ELmap.h:75
HLT enums.
void add(std::string_view context, bool reactedTo)
Definition: ELmap.cc:119
bool ignoredFlag
Definition: ELmap.h:72
std::map< ELextendedID, CountAndLimit > ELmap_counts
Definition: ELmap.h:86
std::map< ELextendedID, StatsCount > ELmap_stats
Definition: ELmap.h:88