1 #include "otsdaq-core/DataProcessorPlugins/UDPDataStreamerConsumer.h"
2 #include "otsdaq-core/MessageFacility/MessageFacility.h"
3 #include "otsdaq-core/Macros/CoutMacros.h"
4 #include "otsdaq-core/Macros/ProcessorPluginMacros.h"
13 UDPDataStreamerConsumer::UDPDataStreamerConsumer(std::string supervisorApplicationUID, std::string bufferUID, std::string processorUID,
const ConfigurationTree& theXDAQContextConfigTree,
const std::string& configurationPath)
14 :
Socket (theXDAQContextConfigTree.getNode(configurationPath).getNode(
"HostIPAddress").getValue<std::string>(),
15 theXDAQContextConfigTree.getNode(configurationPath).getNode(
"HostPort").getValue<unsigned int>())
18 theXDAQContextConfigTree.getNode(configurationPath).getNode(
"HostIPAddress").getValue<std::string>(),
19 theXDAQContextConfigTree.getNode(configurationPath).getNode(
"HostPort").getValue<unsigned int>(),
20 theXDAQContextConfigTree.getNode(configurationPath).getNode(
"StreamToIPAddress").getValue<std::string>(),
21 theXDAQContextConfigTree.getNode(configurationPath).getNode(
"StreamToPort").getValue<unsigned int>()
23 ,
DataConsumer (supervisorApplicationUID, bufferUID, processorUID, HighConsumerPriority)
24 ,
Configurable (theXDAQContextConfigTree, configurationPath)
29 std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << std::endl;
30 std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << std::endl;
31 std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << std::endl;
32 std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << std::endl;
33 std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << std::endl;
34 std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << std::endl;
36 std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ <<
"done!" << std::endl;
40 UDPDataStreamerConsumer::~UDPDataStreamerConsumer(
void)
45 bool UDPDataStreamerConsumer::workLoopThread(toolbox::task::WorkLoop* workLoop)
48 return WorkLoop::continueWorkLoop_;
52 void UDPDataStreamerConsumer::fastRead(
void)
55 if(DataConsumer::read(dataP_, headerP_) < 0)
64 TransmitterSocket::send(streamToSocket_, *dataP_);
65 DataConsumer::setReadSubBuffer<std::string, std::map<std::string, std::string>>();
69 void UDPDataStreamerConsumer::slowRead(
void)
73 if(DataConsumer::read(data_, header_) < 0)
81 TransmitterSocket::send(streamToSocket_, data_);