CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/DQMServices/XdaqCollector/interface/ToDqm.h

Go to the documentation of this file.
00001 // $Id: ToDqm.h,v 1.3 2008/10/23 14:35:33 vpatras Exp $
00002 
00003 /*************************************************************************
00004  * XDAQ Components for Distributed Data Acquisition                      *
00005  * Copyright (C) 2000-2004, CERN.                                        *
00006  * All rights reserved.                                                  *
00007  * Authors: J. Gutleber and L. Orsini                                    *
00008  *                                                                       *
00009  * For the licensing terms see LICENSE.                                  *
00010  * For the list of contributors see CREDITS.                             *
00011  *************************************************************************/
00012 
00013 #ifndef _xmas2dqm_wse_ToDqm_h_
00014 #define _xmas2dqm_wse_ToDqm_h_
00015 
00016 #include <string>
00017 #include <map>
00018 #include "xdaq/ApplicationDescriptor.h"
00019 #include "Exception.h"
00020 
00021 #include "xdata/String.h"
00022 #include "xdata/Vector.h"
00023 #include "xdata/Boolean.h"
00024 #include "xdata/ActionListener.h"
00025 #include "xdata/UnsignedInteger64.h"
00026 #include "xdata/Table.h"
00027 
00028 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00029 #include "DQMServices/Core/interface/DQMStore.h"
00030 #include "DQMServices/Core/interface/MonitorElement.h"
00031 
00032 #include <queue>
00033 #include "toolbox/BSem.h"
00034 #include <pthread.h>
00035 
00036 /*#ifndef Qsize_max
00037 #define Qsize_max 1000
00038 #endif*/
00039 
00040 #include "DQMServices/XdaqCollector/interface/FlashlistElements.h"
00041 
00042 namespace xmas2dqm
00043 {
00044         namespace wse
00045         {
00046                 class ToDqm 
00047                 {
00048                         public:
00049                 
00050                         void digest(
00051                                         const std::string& flashListName, 
00052                                         const std::string& originator, 
00053                                         const std::string& tag, 
00054                                         /*xdata::Table::Reference table*/
00055                                         xdata::Table *table
00056                                         )
00057                                         throw (xmas2dqm::wse::exception::Exception );
00058                                         
00059                         void free_memory();
00060                         
00061                         xdata::String runNumber_;
00062                         
00063                         std::queue<xdata::Table::Reference> QTable_;
00064                         
00065                         std::queue<xdata::Table *> MemoryTable_;
00066                         
00067                         xdata::Bag<xmas2dqm::wse::FlashlistElements> flashlistMonitor_;
00068                         
00069                         //semaphore to protect access to runNumber_
00070                         toolbox::BSem BSem_;            
00071                         
00072                         //allows syncronized access to the queue of LAS data
00073                         pthread_mutex_t LASmutex_;
00074         
00075                         //represents if the queue is (q.size reached max size)  
00076                         pthread_cond_t more_;
00077                         
00078                         //represents if there is space in queue (q.size less than max size)
00079                         pthread_cond_t less_;
00080                         
00081                                         
00082                         static ToDqm *instance();
00083                 private:
00084                         ToDqm();
00085                         ~ToDqm();
00086                         static ToDqm* instance_;
00087                         //DQMStore *be_;
00088                         //MonitorElement *me_;
00089                         int messageCount_;
00090                                 
00091                         
00092                 };
00093         
00094         }
00095 }       
00096 
00097 #endif