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