CMS 3D CMS Logo

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/Utilities/interface/SingleConsumerQ.h"
00005 
00006 #include <map>
00007 
00008 namespace edm
00009 {
00010 
00011 // --- forward declarations:
00012 class ErrorObj;
00013 class ParameterSet;
00014 class ELdestination;
00015 namespace service {
00016 class NamedDestination;
00017 }
00018 
00019 
00020 class MessageLoggerQ
00021 {
00022 public:
00023   // --- enumerate types of messages that can be enqueued:
00024   enum OpCode      // abbrev's used hereinafter
00025   { END_THREAD     // END
00026   , LOG_A_MESSAGE  // LOG
00027   , CONFIGURE      // CFG
00028   , EXTERN_DEST    // EXT
00029   , SUMMARIZE      // SUM
00030   , JOBREPORT      // JOB
00031   , JOBMODE        // MOD
00032   , SHUT_UP        // SHT
00033   , FLUSH_LOG_Q    // FLS
00034   , GROUP_STATS    // GRP
00035   , FJR_SUMMARY    // JRS
00036   };  // OpCode
00037 
00038   // ---  birth via a surrogate:
00039   static  MessageLoggerQ *  instance();
00040 
00041   // ---  post a message to the queue:
00042   static  void  MLqEND();
00043   static  void  MLqLOG( ErrorObj * p );
00044   static  void  MLqCFG( ParameterSet * p );
00045   static  void  MLqEXT( service::NamedDestination* p );
00046   static  void  MLqSUM();
00047   static  void  MLqJOB( std::string * j );
00048   static  void  MLqMOD( std::string * jm );
00049   static  void  MLqSHT();
00050   static  void  MLqFLS();
00051   static  void  MLqGRP(std::string * cat_p);
00052   static  void  MLqJRS(std::map<std::string, double> * sum_p);
00053 
00054   // ---  obtain a message from the queue:
00055   static  void  consume( OpCode & opcode, void * & operand );
00056 
00057 private:
00058   // ---  traditional birth/death, but disallowed to users:
00059   MessageLoggerQ();
00060   ~MessageLoggerQ();
00061 
00062   // --- no copying:
00063   MessageLoggerQ( MessageLoggerQ const & );
00064   void  operator = ( MessageLoggerQ const & );
00065 
00066   // --- buffer parameters:
00067   static  const int  buf_depth = 500;
00068   static  const int  buf_size  = sizeof(OpCode)
00069                                + sizeof(void *);
00070 
00071   // --- data:
00072   static  SingleConsumerQ  buf;
00073 
00074 };  // MessageLoggerQ
00075 
00076 
00077 }  // namespace edm
00078 
00079 
00080 #endif  // FWCore_MessageLogger_MessageLoggerQ_h

Generated on Tue Jun 9 17:36:17 2009 for CMSSW by  doxygen 1.5.4