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 
55 
56 // ----------------------------------------------------------------------
57 // ELlimitsTable:
58 // ----------------------------------------------------------------------
59 
61 
62  friend class ELdestination;
63  friend class ELoutput;
64 
65 public:
66 
67  ELlimitsTable();
69 
70 // ----- Methods invoked by the destination under impetus from the logger:
71 //
72 public:
73  bool add( const ELextendedID & xid );
74  void setTableLimit( int n );
75 
76 // ----- Control methods invoked by the framework:
77 //
78 public:
79 
80  void wipe(); // Clears everything -- counts and limits established.
81  void zero(); // Clears only counts.
82 
83  void setLimit ( const ELstring & id, int n );
84  void setLimit ( const ELseverityLevel & sev, int n );
85  void setInterval( const ELstring & id, int interval );
86  void setInterval( const ELseverityLevel & sev, int interval );
87  void setTimespan( const ELstring & id, int n );
88  void setTimespan( const ELseverityLevel & sev, int n );
89 
91 
92 // ----- Tables and auxilliary private data:
93 //
94 protected:
95 
102 
106 
107 }; // ELlimitsTable
108 
109 
110 // ----------------------------------------------------------------------
111 
112 
113 } // end of namespace service
114 } // end of namespace edm
115 
116 
117 #endif // FWCore_MessageService_ELlimitsTable_h
tuple interval
Definition: MergeJob_cfg.py:20
int severityTimespans[ELseverityLevel::nLevels]
Definition: ELlimitsTable.h:97
bool add(const ELextendedID &xid)
int severityLimits[ELseverityLevel::nLevels]
Definition: ELlimitsTable.h:96
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]
Definition: ELlimitsTable.h:98
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)