CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ToDqm.h
Go to the documentation of this file.
1 // $Id: ToDqm.h,v 1.3 2008/10/23 14:35:33 vpatras Exp $
2 
3 /*************************************************************************
4  * XDAQ Components for Distributed Data Acquisition *
5  * Copyright (C) 2000-2004, CERN. *
6  * All rights reserved. *
7  * Authors: J. Gutleber and L. Orsini *
8  * *
9  * For the licensing terms see LICENSE. *
10  * For the list of contributors see CREDITS. *
11  *************************************************************************/
12 
13 #ifndef _xmas2dqm_wse_ToDqm_h_
14 #define _xmas2dqm_wse_ToDqm_h_
15 
16 #include <string>
17 #include <map>
18 #include "xdaq/ApplicationDescriptor.h"
19 #include "Exception.h"
20 
21 #include "xdata/String.h"
22 #include "xdata/Vector.h"
23 #include "xdata/Boolean.h"
24 #include "xdata/ActionListener.h"
25 #include "xdata/UnsignedInteger64.h"
26 #include "xdata/Table.h"
27 
31 
32 #include <queue>
33 #include "toolbox/BSem.h"
34 #include <pthread.h>
35 
36 /*#ifndef Qsize_max
37 #define Qsize_max 1000
38 #endif*/
39 
41 
42 namespace xmas2dqm
43 {
44  namespace wse
45  {
46  class ToDqm
47  {
48  public:
49 
50  void digest(
51  const std::string& flashListName,
52  const std::string& originator,
53  const std::string& tag,
54  /*xdata::Table::Reference table*/
55  xdata::Table *table
56  )
58 
59  void free_memory();
60 
61  xdata::String runNumber_;
62 
63  std::queue<xdata::Table::Reference> QTable_;
64 
65  std::queue<xdata::Table *> MemoryTable_;
66 
67  xdata::Bag<xmas2dqm::wse::FlashlistElements> flashlistMonitor_;
68 
69  //semaphore to protect access to runNumber_
70  toolbox::BSem BSem_;
71 
72  //allows syncronized access to the queue of LAS data
73  pthread_mutex_t LASmutex_;
74 
75  //represents if the queue is (q.size reached max size)
76  pthread_cond_t more_;
77 
78  //represents if there is space in queue (q.size less than max size)
79  pthread_cond_t less_;
80 
81 
82  static ToDqm *instance();
83  private:
84  ToDqm();
85  ~ToDqm();
86  static ToDqm* instance_;
87  //DQMStore *be_;
88  //MonitorElement *me_;
90 
91 
92  };
93 
94  }
95 }
96 
97 #endif
xdata::Bag< xmas2dqm::wse::FlashlistElements > flashlistMonitor_
Definition: ToDqm.h:67
list table
Definition: asciidump.py:386
pthread_mutex_t LASmutex_
Definition: ToDqm.h:73
toolbox::BSem BSem_
Definition: ToDqm.h:70
void digest(const std::string &flashListName, const std::string &originator, const std::string &tag, xdata::Table *table)
Definition: ToDqm.cc:33
xdata::String runNumber_
Definition: ToDqm.h:61
pthread_cond_t more_
Definition: ToDqm.h:76
pthread_cond_t less_
Definition: ToDqm.h:79
std::queue< xdata::Table::Reference > QTable_
Definition: ToDqm.h:63
static ToDqm * instance()
Definition: ToDqm.cc:6
static ToDqm * instance_
Definition: ToDqm.h:86
void free_memory()
Definition: ToDqm.cc:80
std::queue< xdata::Table * > MemoryTable_
Definition: ToDqm.h:65