otsdaq  v2_04_01
UDPDataListenerProducer.h
1 #ifndef _ots_UDPDataListenerProducer_h_
2 #define _ots_UDPDataListenerProducer_h_
3 
4 #include "otsdaq-core/Configurable/Configurable.h"
5 #include "otsdaq-core/DataManager/DataProducer.h"
6 #include "otsdaq-core/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  public Configurable,
16  public ReceiverSocket
17 {
18  public:
19  UDPDataListenerProducer(std::string supervisorApplicationUID,
20  std::string bufferUID,
21  std::string processorUID,
22  const ConfigurationTree& theXDAQContextConfigTree,
23  const std::string& configurationPath);
24  virtual ~UDPDataListenerProducer(void);
25 
26  protected:
27  bool workLoopThread(toolbox::task::WorkLoop* workLoop);
28  void slowWrite(void);
29  void fastWrite(void);
30  // For slow write
31  std::string data_;
32  std::map<std::string, std::string> header_;
33  // For fast write
34  std::string* dataP_;
35  std::map<std::string, std::string>* headerP_;
36 
37  unsigned long ipAddress_;
38  unsigned short port_;
39 
40  unsigned char lastSeqId_;
41  // bool getNextFragment(void);
42 };
43 
44 } // namespace ots
45 
46 #endif