$treeview $search $mathjax $extrastylesheet
otsdaq
v2_03_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 #include "otsdaq-core/DataProcessorPlugins/DataDecoderConsumer.h" 00002 #include "otsdaq-core/Macros/CoutMacros.h" 00003 #include "otsdaq-core/Macros/ProcessorPluginMacros.h" 00004 #include "otsdaq-core/MessageFacility/MessageFacility.h" 00005 #include "otsdaq-core/TablePluginDataFormats/DataDecoderConsumerTable.h" 00006 00007 #include <unistd.h> 00008 #include <cassert> 00009 #include <iostream> 00010 00011 using namespace ots; 00012 00013 //======================================================================================================================== 00014 DataDecoderConsumer::DataDecoderConsumer( 00015 std::string supervisorApplicationUID, 00016 std::string bufferUID, 00017 std::string processorUID, 00018 const ConfigurationTree& theXDAQContextConfigTree, 00019 const std::string& configurationPath) 00020 : WorkLoop(processorUID) 00021 , DataDecoder(supervisorApplicationUID, bufferUID, processorUID) 00022 , DataConsumer( 00023 supervisorApplicationUID, bufferUID, processorUID, HighConsumerPriority) 00024 , Configurable(theXDAQContextConfigTree, configurationPath) 00025 { 00026 } 00027 00028 //======================================================================================================================== 00029 DataDecoderConsumer::~DataDecoderConsumer(void) {} 00030 00031 //======================================================================================================================== 00032 bool DataDecoderConsumer::workLoopThread(toolbox::task::WorkLoop* workLoop) 00033 { 00034 // std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << processorUID_ << " running!" 00035 // << std::endl; 00036 std::string buffer; 00037 std::map<std::string, std::string> header; 00038 // unsigned long block; 00039 if(DataConsumer::read(buffer, header) < 0) 00040 usleep(100000); 00041 else 00042 { 00043 std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << processorUID_ 00044 << " Buffer: " << buffer << std::endl; 00045 } 00046 return true; 00047 } 00048 00049 DEFINE_OTS_PROCESSOR(DataDecoderConsumer)