/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
FWCore/MessageLogger/interface/ELmap.h
96 строк
3 KB
Matti Kortelainen
Remove ELstring
21 сен 2020, 17:18
21 сен 2020, 17:18
ca50699
Код
Авторство
О чём код?
#ifndef MessageLogger_ELmap_h #define MessageLogger_ELmap_h // ---------------------------------------------------------------------- // // ELmap.h Provides a map class with the semantics of std::map. // Customizers may substitute for this class to provide either // a map with a different allocator, or whatever else. // // We typedef an individual type for each of these maps since // the syntax // typedef map ELmap; // ELlist<ELextededID, Counts, ELextendedID::less> table; // may or may not be valid C++, and if valid probably won't work // everywhere. // // The key types are common enough types (strings and extended id's); // the data types are peculiar to each type of map. We have made the // design choice of grouping all maps in this one file, so that if // a customizer needs to do something else with maps, all the slop is // in one place. // // The drawback is that all the classes that depend on these maps must // include ELmap.h, which pulls in not only the maps and structs they // need but those anybody else needs. Fortunately, only two classes // use maps at all: ELlimitsTable and the ELstatistics destination. // So this drawback is very slight. // // The elements of map semantics which ErrorLogger code rely upon are // listed in ELmap.semantics. // // ---------------------------------------------------------------------- #include <map> #include <string> #include "FWCore/MessageLogger/interface/ELextendedID.h" namespace edm { // ---------------------------------------------------------------------- class LimitAndTimespan { public: int limit; int timespan; int interval; LimitAndTimespan(int lim = -1, int ts = -1, int ivl = -1); }; // LimitAndTimespan class CountAndLimit { public: int n; int aggregateN; time_t lastTime; int limit; int timespan; int interval; int skipped; CountAndLimit(int lim = -1, int ts = -1, int ivl = -1); bool add(); }; // CountAndLimit class StatsCount { public: int n; int aggregateN; bool ignoredFlag; std::string context1; std::string context2; std::string contextLast; StatsCount(); void add(std::string_view context, bool reactedTo); }; // StatsCount // ---------------------------------------------------------------------- typedef std::map<std::string, LimitAndTimespan> ELmap_limits; typedef std::map<ELextendedID, CountAndLimit> ELmap_counts; typedef std::map<ELextendedID, StatsCount> ELmap_stats; // See ELseverityLevel.cc for another map: ELmap_sevTran // ---------------------------------------------------------------------- } // end of namespace edm #endif // MessageLogger_ELmap_h