CMS 3D CMS Logo

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>

List of all members.

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 47 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.

Referenced by instance().

                        : BSem_(toolbox::BSem::FULL),messageCount_(0)
{
        //std::cout << "ToDqm constructor called.... " << std::endl;
        pthread_mutex_init(&LASmutex_,NULL);
        pthread_cond_init(&more_,NULL);
        pthread_cond_init(&less_,NULL);
 
  
}
xmas2dqm::wse::ToDqm::~ToDqm ( ) [private]

Definition at line 21 of file ToDqm.cc.

{

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

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.

{

        std::cout << "inside digest...." << std::endl;
        
        std::map<std::string, std::string, std::less<std::string> >::iterator i;
        
        //std::cout<< "ToDQM->digest : before BSem_.take();" << std::endl;
        //BSem_.take();
        //acquire the mutex - protect access to the queue
        //pthread_mutex_lock(&mymutex_);
   
        //check if the queue is full and wait (a signal that informs that an element has been poped)
        // until there is 'space' in the queue    
        //while (QTable_.size() >= Qsize_max)
        //{
                //pthread_cond_wait(&less_, &mymutex_);
        //}
        
        //push new element to the queue of LAS data
        //QTable_.push(table);
        MemoryTable_.push(table);
        
        //MemoryTable_.push(mtable);
        
        //std::cout << "ToDQM->digest : Queue size = " << QTable_.size() << std::endl;
        
        //std::cout<< "ToDQM->digest : before BSem_.give();" << std::endl;
        
        //signal that a new element has been inserted
        //pthread_cond_signal(&more_);

        //allow access to the queue
        //pthread_mutex_unlock(&mymutex_);
        //BSem_.give();
        
        messageCount_++;
         
}
void xmas2dqm::wse::ToDqm::free_memory ( )

Definition at line 80 of file ToDqm.cc.

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

{       
        std::cout << "free_memory: before MemoryTable.front()" << std::endl;
        
        xdata::Table * temp = MemoryTable_.front();
        delete temp;
        
        //MemoryTable_.front()->xdata::Table::~Table() ;
        
        //MemoryTable_.front()->clear();
        
        
        std::cout << "free_memory: before MemoryTable.pop()" << std::endl;
        MemoryTable_.pop();
        
        std::cout << "free_memory: returning...." << std::endl;
}
xmas2dqm::wse::ToDqm * xmas2dqm::wse::ToDqm::instance ( ) [static]

Member Data Documentation

Definition at line 71 of file ToDqm.h.

Definition at line 68 of file ToDqm.h.

Definition at line 87 of file ToDqm.h.

Referenced by instance().

Definition at line 74 of file ToDqm.h.

Referenced by ToDqm().

Definition at line 80 of file ToDqm.h.

Referenced by ToDqm().

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

Definition at line 66 of file ToDqm.h.

Definition at line 90 of file ToDqm.h.

Definition at line 77 of file ToDqm.h.

Referenced by ToDqm().

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

Definition at line 64 of file ToDqm.h.

Definition at line 62 of file ToDqm.h.