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