CMS 3D CMS Logo

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 
41  unsigned int count;
42  ErrorSummaryEntry(std::string const& cat, std::string const& mod, ELseverityLevel sev, unsigned int cnt = 0)
43  : category(cat), module(mod), severity(sev), count(cnt) {}
44  ErrorSummaryEntry() : category(), module(), severity(), count(0) {}
45  bool operator<(ErrorSummaryEntry const& rhs) const {
46  if (category < rhs.category)
47  return true;
48  if (category > rhs.category)
49  return false;
50  if (module < rhs.module)
51  return true;
52  if (module > rhs.module)
53  return false;
54  if (severity < rhs.severity)
55  return true;
56  if (severity > rhs.severity)
57  return false;
58  if (count < rhs.count)
59  return true;
60  return false;
61  }
62  bool operator==(ErrorSummaryEntry const& rhs) const {
63  return ((category < rhs.category) && (module < rhs.module) && (severity < rhs.severity) && (count < rhs.count));
64  }
65  };
66 
67 } // end of namespace edm
68 
69 #endif // MessageLogger_ErrorSummaryEntry_h
ELseverityLevel severity
bool operator==(ErrorSummaryEntry const &rhs) const
def cat(path)
Definition: eostools.py:401
bool operator<(ErrorSummaryEntry const &rhs) const
HLT enums.
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
ErrorSummaryEntry(std::string const &cat, std::string const &mod, ELseverityLevel sev, unsigned int cnt=0)