CMS 3D CMS Logo

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