CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ErrorSummaryEntry.h
Go to the documentation of this file.
1 #ifndef MessageLogger_ErrorSummaryEntry_h
2 #define MessageLogger_ErrorSummaryEntry_h
3 
5 
6 #include <string>
7 
8 // ----------------------------------------------------------------------
9 //
10 // ErrorSummaryEntry.h - Structure to hold summary of a warning or error
11 // message issued in an event.
12 //
13 // Usage:
14 // if (edm::FreshErrorsExist()) {
15 // std::vector(edm::ErrorSummaryEntry es = edm::LoggedErrorsSummary();
16 // package_as_product_in_the_event (es);
17 // }
18 //
19 // edm::ErrorSummaryEntry is a very simple struct, containing only strings
20 // and an int; it is very suitable for inclusion in the event.
21 //
22 // Unusual C++ practice warning:
23 // edm::ErrorSummaryEntry is a simple struct; its members are public and
24 // are accessed directly rather than through accessor functions. Thus it
25 // **is reasonable** in this case to treat the code defining the
26 // edm::ErrorSummaryEntry as documentation of how to use it.
27 //
28 // 20-Aug-2008 mf Created file.
29 //
30 // 22-Jun-2009 mf Added severity to the structure. This adds just one
31 // integer to the memory used.
32 //
33 // ----------------------------------------------------------------------
34 
35 namespace edm {
36 
38 {
42  unsigned int count;
44  ELseverityLevel sev, unsigned int cnt = 0)
45  : category(cat)
46  , module (mod)
47  , severity(sev)
48  , count(cnt) {}
50  bool operator< (ErrorSummaryEntry const & rhs) const {
51  if (category < rhs.category) return true;
52  if (category > rhs.category) return false;
53  if (module < rhs.module) return true;
54  if (module > rhs.module) return false;
55  if (severity < rhs.severity) return true;
56  if (severity > rhs.severity) return false;
57  if (count < rhs.count) return true;
58  return false;
59  }
60  bool operator== (ErrorSummaryEntry const & rhs) const {
61  return ( (category < rhs.category) && (module < rhs.module)
62  && (severity < rhs.severity) && (count < rhs.count) );
63  }
64 };
65 
66 } // end of namespace edm
67 
68 
69 #endif // MessageLogger_ErrorSummaryEntry_h
70 
ELseverityLevel severity
bool operator==(ErrorSummaryEntry const &rhs) const
def cat
Definition: eostools.py:398
bool operator<(ErrorSummaryEntry const &rhs) const
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
Definition: vlib.h:208
ErrorSummaryEntry(std::string const &cat, std::string const &mod, ELseverityLevel sev, unsigned int cnt=0)