00001 #ifndef FWCore_MessageService_ELstatistics_h 00002 #define FWCore_MessageService_ELstatistics_h 00003 00004 00005 // ---------------------------------------------------------------------- 00006 // 00007 // ELstatistics is a subclass of ELdestination representing the 00008 // provided statistics (for summary) keeping. 00009 // 00010 // 7/8/98 mf Created file. 00011 // 7/2/99 jvr Added noTerminationSummary() function 00012 // 12/20/99 mf Added virtual destructor. 00013 // 6/7/00 web Reflect consolidation of ELdestination/X; consolidate 00014 // ELstatistics/X. 00015 // 6/14/00 web Declare classes before granting friendship. 00016 // 10/4/00 mf Add filterModule() and excludeModule() 00017 // 1/15/00 mf line length control: changed ELoutputLineLen to 00018 // the base class lineLen (no longer static const) 00019 // 3/13/01 mf statisticsMap() 00020 // 4/4/01 mf Removed moduleOfInterest and moduleToExclude, in favor 00021 // of using base class method. 00022 // 1/17/06 mf summary() for use in MessageLogger 00023 // 8/16/07 mf noteGroupedCategory(cat) to support grouping of modules in 00024 // specified categories. Also, a static vector of such categories. 00025 // 6/19/08 mf summaryForJobReport() for use in CMS framework 00026 // 00027 // ---------------------------------------------------------------------- 00028 00029 #include "FWCore/MessageService/interface/ELdestination.h" 00030 00031 #include "FWCore/MessageLogger/interface/ELextendedID.h" 00032 #include "FWCore/MessageLogger/interface/ELmap.h" 00033 #include "FWCore/MessageLogger/interface/ELstring.h" 00034 00035 #include <set> 00036 00037 namespace edm { 00038 00039 00040 // ---------------------------------------------------------------------- 00041 // prerequisite classes: 00042 // ---------------------------------------------------------------------- 00043 00044 class ErrorObj; 00045 namespace service { 00046 class ELadministrator; 00047 class ELdestControl; 00048 00049 00050 // ---------------------------------------------------------------------- 00051 // ELstatistics: 00052 // ---------------------------------------------------------------------- 00053 00054 class ELstatistics : public ELdestination { 00055 00056 friend class ELadministrator; 00057 friend class ELdestControl; 00058 00059 public: 00060 // ----- constructor/destructor: 00061 ELstatistics(); 00062 ELstatistics( std::ostream & osp ); 00063 ELstatistics( int spaceLimit ); 00064 ELstatistics( int spaceLimit, std::ostream & osp ); 00065 ELstatistics( const ELstatistics & orig ); 00066 virtual ~ELstatistics(); 00067 00068 // ----- Methods invoked by the ELadministrator: 00069 // 00070 public: 00071 virtual 00072 ELstatistics * 00073 clone() const; 00074 // Used by attach() to put the destination on the ELadministrators list 00075 //-| There is a note in Design Notes about semantics 00076 //-| of copying a destination onto the list: ofstream 00077 //-| ownership is passed to the new copy. 00078 00079 virtual bool log( const edm::ErrorObj & msg ); 00080 00081 // output( const ELstring & item, const ELseverityLevel & sev ) 00082 // from base class 00083 00084 // ----- Methods invoked by the MessageLoggerScribe, bypassing destControl 00085 // 00086 public: 00087 static void noteGroupedCategory(std::string const & cat); // 8/16/07 mf 00088 00089 00090 // ----- Methods invoked through the ELdestControl handle: 00091 // 00092 protected: 00093 virtual void clearSummary(); 00094 00095 virtual void wipe(); 00096 virtual void zero(); 00097 00098 virtual void summary( ELdestControl & dest, const ELstring & title="" ); 00099 virtual void summary( std::ostream & os , const ELstring & title="" ); 00100 virtual void summary( ELstring & s , const ELstring & title="" ); 00101 virtual void summary( ); 00102 void noTerminationSummary(); 00103 00104 virtual std::map<ELextendedID,StatsCount> statisticsMap() const; 00105 00106 virtual void summaryForJobReport (std::map<std::string, double> & sm); 00107 00108 // summarization( const ELstring & sumLines, const ELstring & sumLines ) 00109 // from base class 00110 00111 // ----- Data affected by methods of specific ELdestControl handle: 00112 // 00113 protected: 00114 int tableLimit; 00115 ELmap_stats stats; 00116 bool updatedStats; 00117 std::ostream & termStream; 00118 00119 bool printAtTermination; 00120 00121 static std::set<std::string> groupedCategories; // 8/16/07 mf 00122 static ELstring formSummary(ELmap_stats & stats); // 8/16/07 mf 00123 00124 // ---- Helper methods specific to MessageLogger applicaton 00125 // 00126 private: 00127 std::string dualLogName(std::string const & s); 00128 ELstatistics & operator=( const ELstatistics & orig ); // verboten 00129 00130 }; // ELstatistics 00131 00132 00133 // ---------------------------------------------------------------------- 00134 00135 00136 } // end of namespace service 00137 } // end of namespace edm 00138 00139 00140 #endif // FWCore_MessageService_ELstatistics_h