otsdaq  v1_01_03
 All Classes Namespaces Functions
DataProducer.cc
1 #include "otsdaq-core/DataManager/DataProducer.h"
2 #include "otsdaq-core/DataManager/DataManagerSingleton.h"
3 #include "otsdaq-core/DataManager/DataManager.h"
4 #include "otsdaq-core/ConfigurationInterface/ConfigurationManager.h"
5 
6 
7 #include <iostream>
8 #include <memory>
9 using namespace ots;
10 
11 //========================================================================================================================
12 DataProducer::DataProducer(std::string supervisorApplicationUID, std::string bufferUID, std::string processorUID, unsigned int bufferSize)
13 : WorkLoop (processorUID)
14 , DataProcessor (supervisorApplicationUID, bufferUID, processorUID)
15 , bufferSize_ (bufferSize)
16 {
17  registerToBuffer();
18 }
19 
20 //========================================================================================================================
21 DataProducer::~DataProducer(void)
22 {
23 }
24 
25 //========================================================================================================================
26 void DataProducer::registerToBuffer(void)
27 {
28  __MOUT__ << "\tProducerID: " << processorUID_ << " is registering to DataManager pointer: " << DataManagerSingleton::getInstance(supervisorApplicationUID_) << std::endl;
29  (DataManagerSingleton::getInstance(supervisorApplicationUID_))->registerProducer(bufferUID_,this);
30  __MOUT__ << "\tProducerID: " << processorUID_ << "...registered" << std::endl;
31 }
32 
33 //========================================================================================================================
34 void DataProducer::startProcessingData(std::string runNumber)
35 {
36  WorkLoop::startWorkLoop();
37 }
38 
39 //========================================================================================================================
40 void DataProducer::stopProcessingData(void)
41 {
42  WorkLoop::stopWorkLoop();
43 }
44 
45