$treeview $search $mathjax $extrastylesheet
otsdaq
v2_03_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 #include "otsdaq-core/DataManager/DataConsumer.h" 00002 00003 #include "otsdaq-core/ConfigurationInterface/ConfigurationManager.h" 00004 #include "otsdaq-core/DataManager/DataManager.h" 00005 #include "otsdaq-core/DataManager/DataManagerSingleton.h" 00006 00007 using namespace ots; 00008 00009 #undef __MF_SUBJECT__ 00010 #define __MF_SUBJECT__ (std::string("Consumer-") + DataProcessor::processorUID_) 00011 00012 //======================================================================================================================== 00013 DataConsumer::DataConsumer(std::string supervisorApplicationUID, 00014 std::string bufferUID, 00015 std::string processorUID, 00016 ConsumerPriority priority) 00017 : WorkLoop(processorUID) 00018 , DataProcessor(supervisorApplicationUID, bufferUID, processorUID) 00019 , priority_(priority) 00020 { 00021 __COUT__ << "Constructor." << __E__; 00022 registerToBuffer(); 00023 __COUT__ << "Constructed." << __E__; 00024 } 00025 00026 //======================================================================================================================== 00027 DataConsumer::~DataConsumer(void) 00028 { 00029 __COUT__ << "Destructor." << __E__; 00030 // unregisterFromBuffer(); 00031 __COUT__ << "Destructed." << __E__; 00032 } 00033 00034 //======================================================================================================================== 00035 DataConsumer::ConsumerPriority DataConsumer::getPriority(void) { return priority_; } 00036 00037 //======================================================================================================================== 00038 // mirror DataProducerBase::registerToBuffer 00039 void DataConsumer::registerToBuffer(void) 00040 { 00041 __COUT__ << "Consumer '" << DataProcessor::processorUID_ 00042 << "' is registering to DataManager Supervisor Buffer '" 00043 << DataProcessor::supervisorApplicationUID_ << ":" 00044 << DataProcessor::bufferUID_ << ".'" << std::endl; 00045 00046 DataManager* dataManager = 00047 (DataManagerSingleton::getInstance(supervisorApplicationUID_)); 00048 00049 dataManager->registerConsumer(bufferUID_, this); 00050 00051 { 00052 __SS__; 00053 dataManager->dumpStatus(&ss); 00054 std::cout << ss.str() << __E__; 00055 } 00056 00057 __COUT__ << "Consumer '" << DataProcessor::processorUID_ << "' Registered." << __E__; 00058 00059 // 00060 // 00061 // __COUT__ << "Registering to DataManager Supervisor '" << 00062 // DataProcessor::supervisorApplicationUID_ << "' and buffer '" << 00063 // DataProcessor::bufferUID_ << "'" << std::endl; 00064 // 00065 // (DataManagerSingleton::getInstance( 00066 // supervisorApplicationUID_))->registerConsumer( 00067 // bufferUID_,this); 00068 // 00069 // __COUT__ << "Registered." << __E__; 00070 } // end registerToBuffer() 00071 00074 // void DataConsumer::unregisterFromBuffer(void) 00075 //{ 00076 // __COUT__ << "Consumer '" << DataProcessor::processorUID_ << 00077 // "' is unregistering to DataManager Supervisor Buffer '" << 00078 // DataProcessor::supervisorApplicationUID_ << ":" << 00079 // DataProcessor::bufferUID_ << ".'" << std::endl; 00080 // 00081 // DataManager* dataManager = 00082 // (DataManagerSingleton::getInstance( 00083 // supervisorApplicationUID_)); 00084 // 00085 // dataManager->unregisterConsumer( 00086 // bufferUID_,DataProcessor::processorUID_); 00087 // 00088 // { 00089 // __SS__; 00090 // dataManager->dumpStatus(&ss); 00091 // std::cout << ss.str() << __E__; 00092 // } 00093 // 00094 // __COUT__ << "Consumer '" << DataProcessor::processorUID_ << 00095 // "' Unregistered." << __E__; 00096 //} //end unregisterFromBuffer() 00097 00098 //======================================================================================================================== 00099 void DataConsumer::startProcessingData(std::string runNumber) 00100 { 00101 WorkLoop::startWorkLoop(); 00102 } 00103 00104 //======================================================================================================================== 00105 void DataConsumer::stopProcessingData(void) { WorkLoop::stopWorkLoop(); }