otsdaq  v1_01_04
 All Classes Namespaces Functions
DataConsumer.cc
1 #include "otsdaq-core/DataManager/DataConsumer.h"
2 
3 #include "otsdaq-core/DataManager/DataManagerSingleton.h"
4 #include "otsdaq-core/DataManager/DataManager.h"
5 #include "otsdaq-core/ConfigurationInterface/ConfigurationManager.h"
6 
7 using namespace ots;
8 
9 //========================================================================================================================
10 DataConsumer::DataConsumer(std::string supervisorApplicationUID, std::string bufferUID, std::string processorUID, ConsumerPriority priority)
11 : WorkLoop (processorUID)
12 , DataProcessor (supervisorApplicationUID, bufferUID, processorUID)
13 , priority_ (priority)
14 
15 {
16  registerToBuffer();
17 }
18 
19 //========================================================================================================================
20 DataConsumer::~DataConsumer(void)
21 {
22 }
23 
24 //========================================================================================================================
25 DataConsumer::ConsumerPriority DataConsumer::getPriority(void)
26 {
27  return priority_;
28 }
29 
30 //========================================================================================================================
31 void DataConsumer::registerToBuffer(void)
32 {
33  std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << "\tConsumerID: " << processorUID_ << " is registering to DataManager pointer: " << DataManagerSingleton::getInstance(supervisorApplicationUID_) << std::endl;
34  (DataManagerSingleton::getInstance(supervisorApplicationUID_))->registerConsumer(bufferUID_,this);
35 }
36 
37 //========================================================================================================================
38 void DataConsumer::startProcessingData(std::string runNumber)
39 {
40  WorkLoop::startWorkLoop();
41 }
42 
43 //========================================================================================================================
44 void DataConsumer::stopProcessingData(void)
45 {
46  WorkLoop::stopWorkLoop();
47 }
48 
49