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 
41 
42 namespace edm {
43  namespace service {
44 
45  // ----------------------------------------------------------------------
46  // Prerequisite class:
47  // ----------------------------------------------------------------------
48 
49  class ELdestination;
50  class ELoutput;
51 
52  // ----------------------------------------------------------------------
53  // ELlimitsTable:
54  // ----------------------------------------------------------------------
55 
56  class ELlimitsTable {
57  friend class ELdestination;
58  friend class ELoutput;
59 
60  public:
61  ELlimitsTable();
63 
64  // ----- Methods invoked by the destination under impetus from the logger:
65  //
66  public:
67  bool add(const ELextendedID& xid);
68  void setTableLimit(int n);
69 
70  // ----- Control methods invoked by the framework:
71  //
72  public:
73  void wipe(); // Clears everything -- counts and limits established.
74  void zero(); // Clears only counts.
75 
76  void setLimit(const ELstring& id, int n);
77  void setLimit(const ELseverityLevel& sev, int n);
78  void setInterval(const ELstring& id, int interval);
79  void setInterval(const ELseverityLevel& sev, int interval);
80  void setTimespan(const ELstring& id, int n);
81  void setTimespan(const ELseverityLevel& sev, int n);
82 
84 
85  // ----- Tables and auxilliary private data:
86  //
87  protected:
94 
98 
99  }; // ELlimitsTable
100 
101  // ----------------------------------------------------------------------
102 
103  } // end of namespace service
104 } // end of namespace edm
105 
106 #endif // FWCore_MessageService_ELlimitsTable_h
int severityTimespans[ELseverityLevel::nLevels]
Definition: ELlimitsTable.h:89
bool add(const ELextendedID &xid)
int severityLimits[ELseverityLevel::nLevels]
Definition: ELlimitsTable.h:88
ELlimitsTable & operator=(const ELlimitsTable &t)
void setInterval(const ELstring &id, int interval)
int severityIntervals[ELseverityLevel::nLevels]
Definition: ELlimitsTable.h:90
HLT enums.
std::map< ELstring, LimitAndTimespan > ELmap_limits
Definition: ELmap.h:84
void setTimespan(const ELstring &id, int n)
std::map< ELextendedID, CountAndLimit > ELmap_counts
Definition: ELmap.h:86
std::string ELstring
Definition: ELstring.h:21
void setLimit(const ELstring &id, int n)