CMS 3D CMS Logo

ELlimitsTable.h
Go to the documentation of this file.
1 #ifndef FWCore_MessageService_ELlimitsTable_h
2 #define FWCore_MessageService_ELlimitsTable_h
3 
4 // ----------------------------------------------------------------------
5 //
6 // ELlimitsTable is a class holding two maps: One listing various
7 // limits associated with each id, and one counting occurrences
8 // and tracking latest times of each type of extended-id
9 // (id + severity + module + subroutine + process).
10 // In addition, there is a table by severity of defaults,
11 // and a single wildcard default limit.
12 //
13 // The fundamental operation is
14 //
15 // bool add( const ELextendedID & )
16 //
17 // which checks if the extended id is in the main map. If it is not, it
18 // looks for the specified limit (by id, then severity, then wildcard) and
19 // cretes an entry in the main map for this extended id. The count is
20 // incremented, (perhaps zero-ed first if the timespan was exceeded) and
21 // checked against its limit. If the limit is not exceeded, OR is exceeded
22 // by 2**N times the limit, this returns true.
23 //
24 // Limits of -1 mean react to this error always.
25 // Limits of 0 in the auxilliary defaults indicate that the corresponding
26 // limit was not specified.
27 //
28 // 7/6/98 mf Created file.
29 // 6/7/00 web Reflect consolidation of ELdestination/X
30 // 6/14/00 web Declare classes before granting friendship.
31 // 6/15/01 mf Grant friendship to ELoutput so that faithful copying of
32 // ELoutput destinations becomes possible.
33 // 5/16/06 mf Added wildcardInterval member, and severityIntervals
34 //
35 // ----------------------------------------------------------------------
36 
40 
41 #include <string>
42 
43 namespace edm {
44  namespace service {
45 
46  // ----------------------------------------------------------------------
47  // Prerequisite class:
48  // ----------------------------------------------------------------------
49 
50  class ELdestination;
51  class ELoutput;
52 
53  // ----------------------------------------------------------------------
54  // ELlimitsTable:
55  // ----------------------------------------------------------------------
56 
57  class ELlimitsTable {
58  friend class ELdestination;
59  friend class ELoutput;
60 
61  public:
62  ELlimitsTable();
64 
65  // ----- Methods invoked by the destination under impetus from the logger:
66  //
67  public:
68  bool add(const ELextendedID& xid);
69  void setTableLimit(int n);
70 
71  // ----- Control methods invoked by the framework:
72  //
73  public:
74  void wipe(); // Clears everything -- counts and limits established.
75  void zero(); // Clears only counts.
76 
77  void setLimit(const std::string& id, int n);
78  void setLimit(const messagelogger::ELseverityLevel& sev, int n);
79  void setInterval(const std::string& id, int interval);
81  void setTimespan(const std::string& id, int n);
82  void setTimespan(const messagelogger::ELseverityLevel& sev, int n);
83 
85 
86  // ----- Tables and auxilliary private data:
87  //
88  protected:
95 
99 
100  }; // ELlimitsTable
101 
102  // ----------------------------------------------------------------------
103 
104  } // end of namespace service
105 } // end of namespace edm
106 
107 #endif // FWCore_MessageService_ELlimitsTable_h
void setLimit(const std::string &id, int n)
void setTimespan(const std::string &id, int n)
void setInterval(const std::string &id, int interval)
std::map< std::string, LimitAndTimespan > ELmap_limits
Definition: ELmap.h:84
bool add(const ELextendedID &xid)
ELlimitsTable & operator=(const ELlimitsTable &t)
int severityIntervals[messagelogger::ELseverityLevel::nLevels]
Definition: ELlimitsTable.h:91
int severityTimespans[messagelogger::ELseverityLevel::nLevels]
Definition: ELlimitsTable.h:90
HLT enums.
int severityLimits[messagelogger::ELseverityLevel::nLevels]
Definition: ELlimitsTable.h:89
std::map< ELextendedID, CountAndLimit > ELmap_counts
Definition: ELmap.h:86