00001 #ifndef FWCore_MessageService_ELdestination_h 00002 #define FWCore_MessageService_ELdestination_h 00003 00004 00005 // ---------------------------------------------------------------------- 00006 // 00007 // ELdestination is a virtual class defining the interface to a 00008 // destination. Concrete classes derived from this include 00009 // ELoutput and ELstatistics. The ELadministrator owns 00010 // a list of ELdestination* as well as the objects those 00011 // list elements point to. 00012 // 00013 // 7/5/98 mf Created file. 00014 // 6/16/99 jvr Allows suppress/include options on destinations 00015 // 7/1/99 mf Forward-declared ELdestControl for strict C++ (thanks cg). 00016 // 7/2/99 jvr Added separate/attachTime, Epilogue, and Serial options 00017 // 12/20/99 mf Added virtual destructor. 00018 // 6/7/00 web Consolidated ELdestination/X; add filterModule() 00019 // 6/14/00 web Declare classes before granting friendship. 00020 // 10/4/00 mf Add excludeModule 00021 // 1/15/01 mf setLineLength() 00022 // 2/13/01 mf fix written by pc to accomodate NT problem with 00023 // static init { $001$ }. Corresponding fix is in .cc file. 00024 // 3/13/01 mf statisticsMap() 00025 // 04/04/01 mf add ignoreMOdule and respondToModule 00026 // 6/23/03 mf changeFile() and flush() 00027 // 1/10/06 mf finish 00028 // 6/19/08 mf summaryForJobReport() 00029 // 00030 // ---------------------------------------------------------------------- 00031 00032 #include "FWCore/MessageService/interface/ELlimitsTable.h" 00033 #include "FWCore/MessageService/interface/ELset.h" 00034 00035 #include "FWCore/MessageLogger/interface/ELstring.h" 00036 #include "FWCore/MessageLogger/interface/ErrorObj.h" 00037 #include "FWCore/MessageLogger/interface/ELextendedID.h" 00038 00039 namespace edm { 00040 namespace service { 00041 00042 // ---------------------------------------------------------------------- 00043 // prerequisite classes: 00044 // ---------------------------------------------------------------------- 00045 00046 class ELdestControl; 00047 class ELadministrator; 00048 00049 00050 // ---------------------------------------------------------------------- 00051 // ELdestination: 00052 // ---------------------------------------------------------------------- 00053 00054 class ELdestination { 00055 00056 friend class ELadministrator; 00057 friend class ELdestControl; 00058 00059 public: 00060 00061 ELdestination(); 00062 virtual ~ELdestination(); 00063 00064 // ----- Methods invoked by the ELadministrator: 00065 // 00066 public: 00067 virtual ELdestination * clone() const = 0; 00068 virtual bool log( const edm::ErrorObj & msg ); 00069 00070 virtual void summarization( 00071 const edm::ELstring & title, 00072 const edm::ELstring & sumLines ); 00073 00074 virtual ELstring getNewline() const; 00075 00076 virtual void finish(); 00077 00078 // ----- Methods invoked through the ELdestControl handle: 00079 // 00080 protected: 00081 virtual void clearSummary(); 00082 virtual void wipe(); 00083 virtual void zero(); 00084 virtual void filterModule( ELstring const & moduleName ); 00085 virtual void excludeModule( ELstring const & moduleName ); 00086 virtual void ignoreModule( ELstring const & moduleName ); 00087 virtual void respondToModule( ELstring const & moduleName ); 00088 virtual bool thisShouldBeIgnored(const ELstring & s) const; 00089 00090 virtual void summary( ELdestControl & dest, const ELstring & title="" ); 00091 virtual void summary( std::ostream & os , const ELstring & title="" ); 00092 virtual void summary( ELstring & s , const ELstring & title="" ); 00093 virtual void summary( ); 00094 virtual void summaryForJobReport(std::map<std::string, double> & sm); 00095 00096 virtual void setTableLimit( int n ); 00097 00098 virtual std::map<ELextendedID,StatsCount> statisticsMap() const; 00099 00100 virtual void changeFile (std::ostream & os); 00101 virtual void changeFile (const ELstring & filename); 00102 virtual void flush(); 00103 00104 // ----- Select output format options: 00105 // 00106 private: 00107 virtual void suppressText(); virtual void includeText(); // $$ jvr 00108 virtual void suppressModule(); virtual void includeModule(); 00109 virtual void suppressSubroutine(); virtual void includeSubroutine(); 00110 virtual void suppressTime(); virtual void includeTime(); 00111 virtual void suppressContext(); virtual void includeContext(); 00112 virtual void suppressSerial(); virtual void includeSerial(); 00113 virtual void useFullContext(); virtual void useContext(); 00114 virtual void separateTime(); virtual void attachTime(); 00115 virtual void separateEpilogue(); virtual void attachEpilogue(); 00116 virtual void noTerminationSummary(); 00117 virtual int setLineLength(int len); virtual int getLineLength() const; 00118 00119 // ----- Data affected by methods of the ELdestControl handle: 00120 // 00121 protected: 00122 ELseverityLevel threshold; 00123 ELseverityLevel traceThreshold; 00124 ELlimitsTable limits; 00125 ELstring preamble; 00126 ELstring newline; 00127 ELstring indent; 00128 int lineLength; 00129 bool ignoreMostModules; 00130 ELset_string respondToThese; 00131 bool respondToMostModules; 00132 ELset_string ignoreThese; 00133 // Fix $001 2/13/01 mf 00134 #ifndef DEFECT_NO_STATIC_CONST_INIT 00135 static const int defaultLineLength = 80; 00136 #else 00137 static const int defaultLineLength; 00138 #endif 00139 00140 // ----- Verboten methods: 00141 // 00142 private: 00143 ELdestination( const ELdestination & orig ); 00144 ELdestination& operator= ( const ELdestination & orig ); 00145 00146 }; // ELdestination 00147 00148 struct close_and_delete { 00149 void operator()(std::ostream* os) const; 00150 }; 00151 00152 } // end of namespace service 00153 } // end of namespace edm 00154 00155 00156 #endif // FWCore_MessageService_ELdestination_h