CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/FWCore/MessageService/interface/ThreadQueue.h

Go to the documentation of this file.
00001 #ifndef FWCore_MessageService_ThreadQueue_h
00002 #define FWCore_MessageService_ThreadQueue_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     MessageService
00006 // Class  :     ThreadQueue
00007 // 
00016 //
00017 // Original Author:  mf and cdj
00018 //         Created:  Fri Aug  7 10:19:58 CDT 2009
00019 // $Id: ThreadQueue.h,v 1.1 2009/08/12 22:22:01 fischler Exp $
00020 //
00021 
00022 #include "FWCore/MessageLogger/interface/MessageLoggerQ.h"
00023 #include "FWCore/Utilities/interface/SingleConsumerQ.h"
00024 
00025 
00026 
00027 
00028 namespace edm {
00029 namespace service {
00030 
00031 class ThreadQueue
00032 {
00033 
00034    public:
00035       ThreadQueue();
00036       virtual ~ThreadQueue();
00037 
00038       // ---------- const member functions ---------------------
00039 
00040       // ---------- static member functions --------------------
00041 
00042       // ---------- member functions ---------------------------
00043 
00044   // ---  obtain a message from the queue:
00045   void  consume( MessageLoggerQ::OpCode & opcode, void * & operand );
00046 
00047   // ---  place a message onto the queue:
00048   void  produce( MessageLoggerQ::OpCode opcode, void *   operand );
00049 
00050  
00051    private:
00052       ThreadQueue(const ThreadQueue&); // stop default
00053 
00054       const ThreadQueue& operator=(const ThreadQueue&); // stop default
00055 
00056       // ---------- member data --------------------------------
00057 
00058   // --- buffer parameters:  (were private but needed by MainTrhreadMLscribe
00059   static  const int  buf_depth = 500;
00060   static  const int  buf_size  = sizeof(MessageLoggerQ::OpCode)
00061                                + sizeof(void *);
00062   SingleConsumerQ  m_buf;
00063 
00064 };
00065 
00066 } // end namespace service
00067 } // end namespace edm
00068 
00069 #endif