otsdaq  v1_01_04
 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  __COUT__ << "\tProducerID: " << processorUID_ << " is registering to DataManager pointer: " << DataManagerSingleton::getInstance(supervisorApplicationUID_) << std::endl;
29  (DataManagerSingleton::getInstance(supervisorApplicationUID_))->registerProducer(bufferUID_,this);
30  __COUT__ << "\tProducerID: " << processorUID_ << "...registered" << std::endl;
31 }
32 
33 //========================================================================================================================
34 void DataProducer::startProcessingData(std::string runNumber)
35 {
36  __COUT__ << "startWorkLoop..." << std::endl;
37  WorkLoop::startWorkLoop();
38 }
39 
40 //========================================================================================================================
41 void DataProducer::stopProcessingData(void)
42 {
43  __COUT__ << "stopWorkLoop..." << std::endl;
44  WorkLoop::stopWorkLoop();
45 }
46 
47