CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes
xmas2dqm::wse::ToDqm Class Reference

#include <ToDqm.h>

Public Member Functions

void digest (const std::string &flashListName, const std::string &originator, const std::string &tag, xdata::Table *table) throw (xmas2dqm::wse::exception::Exception )
 
void free_memory ()
 

Static Public Member Functions

static ToDqminstance ()
 

Public Attributes

toolbox::BSem BSem_
 
xdata::Bag
< xmas2dqm::wse::FlashlistElements
flashlistMonitor_
 
pthread_mutex_t LASmutex_
 
pthread_cond_t less_
 
std::queue< xdata::Table * > MemoryTable_
 
pthread_cond_t more_
 
std::queue
< xdata::Table::Reference > 
QTable_
 
xdata::String runNumber_
 

Private Member Functions

 ToDqm ()
 
 ~ToDqm ()
 

Private Attributes

int messageCount_
 

Static Private Attributes

static ToDqminstance_ = 0
 

Detailed Description

Definition at line 46 of file ToDqm.h.

Constructor & Destructor Documentation

xmas2dqm::wse::ToDqm::ToDqm ( )
private

Definition at line 11 of file ToDqm.cc.

References LASmutex_, less_, more_, and NULL.

11  : BSem_(toolbox::BSem::FULL),messageCount_(0)
12 {
13  //std::cout << "ToDqm constructor called.... " << std::endl;
14  pthread_mutex_init(&LASmutex_,NULL);
15  pthread_cond_init(&more_,NULL);
16  pthread_cond_init(&less_,NULL);
17 
18 
19 }
pthread_mutex_t LASmutex_
Definition: ToDqm.h:73
toolbox::BSem BSem_
Definition: ToDqm.h:70
#define NULL
Definition: scimark2.h:8
pthread_cond_t more_
Definition: ToDqm.h:76
pthread_cond_t less_
Definition: ToDqm.h:79
xmas2dqm::wse::ToDqm::~ToDqm ( )
private

Definition at line 21 of file ToDqm.cc.

22 {
23 
24  //The implementation has detected an attempt to destroy the object referenced by mutex while
25  //it is locked or referenced (for example, while being used in a pthread_cond_timedwait() or pthread_cond_wait()) by another thread.
26 
27  //pthread_mutex_unlock(&mymutex_);
28  //pthread_mutex_destroy(&mymutex_);
29 }

Member Function Documentation

void xmas2dqm::wse::ToDqm::digest ( const std::string &  flashListName,
const std::string &  originator,
const std::string &  tag,
xdata::Table *  table 
)
throw (xmas2dqm::wse::exception::Exception
)

Definition at line 33 of file ToDqm.cc.

References gather_cfg::cout, and i.

Referenced by xmas2dqm::wse::XmasToDQM::LASReadoutWorkLoop().

41 {
42 
43  std::cout << "inside digest...." << std::endl;
44 
45  std::map<std::string, std::string, std::less<std::string> >::iterator i;
46 
47  //std::cout<< "ToDQM->digest : before BSem_.take();" << std::endl;
48  //BSem_.take();
49  //acquire the mutex - protect access to the queue
50  //pthread_mutex_lock(&mymutex_);
51 
52  //check if the queue is full and wait (a signal that informs that an element has been poped)
53  // until there is 'space' in the queue
54  //while (QTable_.size() >= Qsize_max)
55  //{
56  //pthread_cond_wait(&less_, &mymutex_);
57  //}
58 
59  //push new element to the queue of LAS data
60  //QTable_.push(table);
61  MemoryTable_.push(table);
62 
63  //MemoryTable_.push(mtable);
64 
65  //std::cout << "ToDQM->digest : Queue size = " << QTable_.size() << std::endl;
66 
67  //std::cout<< "ToDQM->digest : before BSem_.give();" << std::endl;
68 
69  //signal that a new element has been inserted
70  //pthread_cond_signal(&more_);
71 
72  //allow access to the queue
73  //pthread_mutex_unlock(&mymutex_);
74  //BSem_.give();
75 
76  messageCount_++;
77 
78 }
list table
Definition: asciidump.py:386
int i
Definition: DBlmapReader.cc:9
std::queue< xdata::Table * > MemoryTable_
Definition: ToDqm.h:65
tuple cout
Definition: gather_cfg.py:121
void xmas2dqm::wse::ToDqm::free_memory ( )

Definition at line 80 of file ToDqm.cc.

References gather_cfg::cout, and groupFilesInBlocks::temp.

81 {
82  std::cout << "free_memory: before MemoryTable.front()" << std::endl;
83 
84  xdata::Table * temp = MemoryTable_.front();
85  delete temp;
86 
87  //MemoryTable_.front()->xdata::Table::~Table() ;
88 
89  //MemoryTable_.front()->clear();
90 
91 
92  std::cout << "free_memory: before MemoryTable.pop()" << std::endl;
93  MemoryTable_.pop();
94 
95  std::cout << "free_memory: returning...." << std::endl;
96 }
std::queue< xdata::Table * > MemoryTable_
Definition: ToDqm.h:65
tuple cout
Definition: gather_cfg.py:121
xmas2dqm::wse::ToDqm * xmas2dqm::wse::ToDqm::instance ( )
static

Member Data Documentation

toolbox::BSem xmas2dqm::wse::ToDqm::BSem_

Definition at line 70 of file ToDqm.h.

xdata::Bag<xmas2dqm::wse::FlashlistElements> xmas2dqm::wse::ToDqm::flashlistMonitor_

Definition at line 67 of file ToDqm.h.

Referenced by XmasToDQMSource::analyze().

xmas2dqm::wse::ToDqm * xmas2dqm::wse::ToDqm::instance_ = 0
staticprivate

Definition at line 86 of file ToDqm.h.

Referenced by instance().

pthread_mutex_t xmas2dqm::wse::ToDqm::LASmutex_

Definition at line 73 of file ToDqm.h.

Referenced by ToDqm().

pthread_cond_t xmas2dqm::wse::ToDqm::less_

Definition at line 79 of file ToDqm.h.

Referenced by ToDqm().

std::queue<xdata::Table *> xmas2dqm::wse::ToDqm::MemoryTable_

Definition at line 65 of file ToDqm.h.

Referenced by XmasToDQMSource::analyze().

int xmas2dqm::wse::ToDqm::messageCount_
private

Definition at line 89 of file ToDqm.h.

pthread_cond_t xmas2dqm::wse::ToDqm::more_

Definition at line 76 of file ToDqm.h.

Referenced by ToDqm().

std::queue<xdata::Table::Reference> xmas2dqm::wse::ToDqm::QTable_

Definition at line 63 of file ToDqm.h.

xdata::String xmas2dqm::wse::ToDqm::runNumber_

Definition at line 61 of file ToDqm.h.

Referenced by XmasToDQMEventInfo::analyze(), and XmasToDQMSource::analyze().