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