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 
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(const ELstring& context, bool reactedTo);
79 
80  }; // StatsCount
81 
82  // ----------------------------------------------------------------------
83 
84  typedef std::map<ELstring, 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
LimitAndTimespan(int lim=-1, int ts=-1, int ivl=-1)
Definition: ELmap.cc:32
ELstring context2
Definition: ELmap.h:74
int aggregateN
Definition: ELmap.h:71
ELstring context1
Definition: ELmap.h:73
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
time_t lastTime
Definition: ELmap.h:57
ELstring contextLast
Definition: ELmap.h:75
HLT enums.
bool ignoredFlag
Definition: ELmap.h:72
std::map< ELstring, LimitAndTimespan > ELmap_limits
Definition: ELmap.h:84
std::map< ELextendedID, CountAndLimit > ELmap_counts
Definition: ELmap.h:86
std::string ELstring
Definition: ELstring.h:21
std::map< ELextendedID, StatsCount > ELmap_stats
Definition: ELmap.h:88