CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/FWCore/MessageLogger/interface/MessageLoggerQ.h

Go to the documentation of this file.
00001 #ifndef FWCore_MessageLogger_MessageLoggerQ_h
00002 #define FWCore_MessageLogger_MessageLoggerQ_h
00003 
00004 #include "FWCore/MessageLogger/interface/ELseverityLevel.h"
00005 
00006 #include "boost/shared_ptr.hpp"
00007 
00008 #include <string>
00009 #include <map>
00010 #include <set>
00011 
00012 namespace edm
00013 {
00014 
00015 // --- forward declarations:
00016 class ErrorObj;
00017 class ParameterSet;
00018 class ELdestination;
00019 namespace service {
00020 class NamedDestination;
00021 class AbstractMLscribe;
00022 }
00023 
00024 
00025 class MessageLoggerQ
00026 {
00027 public:
00028   // --- enumerate types of messages that can be enqueued:
00029   enum OpCode      // abbrev's used hereinafter
00030   { END_THREAD     // END
00031   , LOG_A_MESSAGE  // LOG
00032   , CONFIGURE      // CFG -- handshaked
00033   , EXTERN_DEST    // EXT
00034   , SUMMARIZE      // SUM
00035   , JOBREPORT      // JOB
00036   , JOBMODE        // MOD
00037   , SHUT_UP        // SHT
00038   , FLUSH_LOG_Q    // FLS -- handshaked
00039   , GROUP_STATS    // GRP
00040   , FJR_SUMMARY    // JRS -- handshaked
00041   };  // OpCode
00042 
00043   // ---  birth via a surrogate:
00044   static  MessageLoggerQ *  instance();
00045 
00046   // ---  post a message to the queue:
00047   static  void  MLqEND();
00048   static  void  MLqLOG( ErrorObj * p );
00049   static  void  MLqCFG( ParameterSet * p );
00050   static  void  MLqEXT( service::NamedDestination* p );
00051   static  void  MLqSUM();
00052   static  void  MLqJOB( std::string * j );
00053   static  void  MLqMOD( std::string * jm );
00054   static  void  MLqSHT();
00055   static  void  MLqFLS();
00056   static  void  MLqGRP(std::string * cat_p);
00057   static  void  MLqJRS(std::map<std::string, double> * sum_p);
00058 
00059   // ---  bookkeeping for single-thread mode
00060   static  void  setMLscribe_ptr
00061      (boost::shared_ptr<edm::service::AbstractMLscribe>  m);
00062 
00063   // ---  helper for scribes
00064   static bool handshaked ( const OpCode & op );
00065 
00066   // --- special control of standAlone logging behavior
00067   static  void standAloneThreshold(std::string const & severity);
00068   static  void squelch(std::string const & category);
00069   static  bool ignore ( edm::ELseverityLevel const & severity, 
00070                         std::string const & category );
00071                         
00072 private:
00073   // ---  traditional birth/death, but disallowed to users:
00074   MessageLoggerQ();
00075   ~MessageLoggerQ();
00076 
00077   // ---  place an item onto the queue, or execute the command directly
00078   static  void  simpleCommand( OpCode opcode, void * operand );
00079   static  void  handshakedCommand( OpCode opcode, 
00080                                    void * operand, 
00081                                    std::string const & commandMnemonic);
00082 
00083   // --- no copying:
00084   MessageLoggerQ( MessageLoggerQ const & );
00085   void  operator = ( MessageLoggerQ const & );
00086 
00087   // --- data:
00088   static  boost::shared_ptr<edm::service::AbstractMLscribe> mlscribe_ptr;
00089   static  edm::ELseverityLevel threshold;
00090   static  std::set<std::string> squelchSet;
00091   
00092 };  // MessageLoggerQ
00093 
00094 
00095 }  // namespace edm
00096 
00097 
00098 #endif  // FWCore_MessageLogger_MessageLoggerQ_h