otsdaq  v1_01_02
 All Classes Namespaces Functions
UDPDataListenerProducer.h
1 #ifndef _ots_UDPDataListenerProducer_h_
2 #define _ots_UDPDataListenerProducer_h_
3 
4 #include "otsdaq-core/NetworkUtilities/ReceiverSocket.h" // Make sure this is always first because <sys/types.h> (defined in Socket.h) must be first
5 #include "otsdaq-core/DataManager/DataProducer.h"
6 #include "otsdaq-core/ConfigurationInterface/Configurable.h"
7 
8 #include <string>
9 
10 namespace ots
11 {
12 
13 class ConfigurationTree;
14 
16 {
17 public:
18  UDPDataListenerProducer (std::string supervisorApplicationUID, std::string bufferUID, std::string processorUID, const ConfigurationTree& theXDAQContextConfigTree, const std::string& configurationPath);
19  virtual ~UDPDataListenerProducer(void);
20 
21 protected:
22  bool workLoopThread(toolbox::task::WorkLoop* workLoop);
23  void slowWrite (void);
24  void fastWrite (void);
25  //For slow write
26  std::string data_;
27  std::map<std::string,std::string> header_;
28  //For fast write
29  std::string* dataP_;
30  std::map<std::string,std::string>* headerP_;
31 
32  unsigned long ipAddress_;
33  unsigned short port_;
34 
35  //bool getNextFragment(void);
36 };
37 
38 }
39 
40 #endif