Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
DQMServices
XdaqCollector
src
ToDqm.cc
Go to the documentation of this file.
1
#include "
DQMServices/XdaqCollector/interface/ToDqm.h
"
2
//#include "FWCore/ServiceRegistry/interface/Service.h"
3
4
5
xmas2dqm::wse::ToDqm
*
xmas2dqm::wse::ToDqm::instance_
= 0;
6
xmas2dqm::wse::ToDqm
*
xmas2dqm::wse::ToDqm::instance
()
7
{
8
if
(
instance_
== 0)
instance_
=
new
xmas2dqm::wse::ToDqm
();
return
instance_
;
9
}
10
11
xmas2dqm::wse::ToDqm::ToDqm
() : 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
}
20
21
xmas2dqm::wse::ToDqm::~ToDqm
()
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
}
30
31
32
void
xmas2dqm::wse::ToDqm::digest
33
(
34
const
std::string
& flashListName,
35
const
std::string
& originator,
36
const
std::string
&
tag
,
37
/*xdata::Table::Reference table*/
38
xdata::Table *
table
39
)
40
throw
(
xmas2dqm::wse::exception::Exception
)
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
}
79
80
void
xmas2dqm::wse::ToDqm::free_memory
()
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
}
97
asciidump.table
list table
Definition:
asciidump.py:386
i
int i
Definition:
DBlmapReader.cc:9
xmas2dqm::wse::ToDqm::~ToDqm
~ToDqm()
Definition:
ToDqm.cc:21
xmas2dqm::wse::ToDqm::LASmutex_
pthread_mutex_t LASmutex_
Definition:
ToDqm.h:73
xmas2dqm::wse::ToDqm::ToDqm
ToDqm()
Definition:
ToDqm.cc:11
xmas2dqm::wse::ToDqm::digest
void digest(const std::string &flashListName, const std::string &originator, const std::string &tag, xdata::Table *table)
Definition:
ToDqm.cc:33
groupFilesInBlocks.temp
temp
Definition:
groupFilesInBlocks.py:140
NULL
#define NULL
Definition:
scimark2.h:8
xmas2dqm::wse::exception::Exception
Definition:
Exception.h:22
ToDqm.h
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
xmas2dqm::wse::ToDqm::more_
pthread_cond_t more_
Definition:
ToDqm.h:76
xmas2dqm::wse::ToDqm::less_
pthread_cond_t less_
Definition:
ToDqm.h:79
GlobalPosition_Frontier_DevDB_cff.tag
tuple tag
Definition:
GlobalPosition_Frontier_DevDB_cff.py:11
xmas2dqm::wse::ToDqm::instance
static ToDqm * instance()
Definition:
ToDqm.cc:6
xmas2dqm::wse::ToDqm::instance_
static ToDqm * instance_
Definition:
ToDqm.h:86
xmas2dqm::wse::ToDqm::free_memory
void free_memory()
Definition:
ToDqm.cc:80
gather_cfg.cout
tuple cout
Definition:
gather_cfg.py:121
xmas2dqm::wse::ToDqm
Definition:
ToDqm.h:46
Generated for CMSSW Reference Manual by
1.8.5