/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
DataFormats/Common/interface/ErrorSummaryEntry.h
70 строк
2 KB
Matti Kortelainen
Move stored types in io_v1 namespace, reset class versions to 3
22 май 2026, 18:18
22 май 2026, 18:18
909f324
Код
Авторство
О чём код?
#ifndef DataFormats_Common_ErrorSummaryEntry_h #define DataFormats_Common_ErrorSummaryEntry_h #include "DataFormats/Common/interface/ELseverityLevel.h" #include <string> // ---------------------------------------------------------------------- // // ErrorSummaryEntry.h - Structure to hold summary of a warning or error // message issued in an event. // // Usage: // if (edm::FreshErrorsExist()) { // std::vector(edm::ErrorSummaryEntry es = edm::LoggedErrorsSummary(); // package_as_product_in_the_event (es); // } // // edm::ErrorSummaryEntry is a very simple struct, containing only strings // and an int; it is very suitable for inclusion in the event. // // Unusual C++ practice warning: // edm::ErrorSummaryEntry is a simple struct; its members are public and // are accessed directly rather than through accessor functions. Thus it // **is reasonable** in this case to treat the code defining the // edm::ErrorSummaryEntry as documentation of how to use it. // // 20-Aug-2008 mf Created file. // // 22-Jun-2009 mf Added severity to the structure. This adds just one // integer to the memory used. // // ---------------------------------------------------------------------- namespace edm { namespace io_v1 { struct ErrorSummaryEntry { std::string category; std::string module; ELseverityLevel severity; unsigned int count; ErrorSummaryEntry(std::string const& cat, std::string const& mod, ELseverityLevel sev, unsigned int cnt = 0) : category(cat), module(mod), severity(sev), count(cnt) {} ErrorSummaryEntry() : category(), module(), severity(), count(0) {} bool operator<(ErrorSummaryEntry const& rhs) const { if (category < rhs.category) return true; if (category > rhs.category) return false; if (module < rhs.module) return true; if (module > rhs.module) return false; if (severity < rhs.severity) return true; if (severity > rhs.severity) return false; if (count < rhs.count) return true; return false; } bool operator==(ErrorSummaryEntry const& rhs) const { return ((category < rhs.category) && (module < rhs.module) && (severity < rhs.severity) && (count < rhs.count)); } }; } // namespace io_v1 using ErrorSummaryEntry = io_v1::ErrorSummaryEntry; } // end of namespace edm #endif // DataFormats_Common_ErrorSummaryEntry_h