otsdaq  v2_01_00
TCPDataListenerProducer.h
1 #ifndef _ots_TCPDataListenerProducer_h_
2 #define _ots_TCPDataListenerProducer_h_
3 
4 #include "otsdaq-core/NetworkUtilities/TCPSocket.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/Configurable/Configurable.h"
7 
8 #include <string>
9 
10 namespace ots
11 {
12 
13 class ConfigurationTree;
14 
16 {
17 public:
18  TCPDataListenerProducer (std::string supervisorApplicationUID, std::string bufferUID, std::string processorUID,
19  const ConfigurationTree& theXDAQContextConfigTree, const std::string& configurationPath);
20  virtual ~TCPDataListenerProducer(void);
21 
22 protected:
23  bool workLoopThread(toolbox::task::WorkLoop* workLoop);
24  void slowWrite (void);
25  void fastWrite (void);
26  //For slow write
27  std::string data_;
28  std::map<std::string,std::string> header_;
29  //For fast write
30  std::string* dataP_;
31  std::map<std::string,std::string>* headerP_;
32 
33  std::string ipAddress_;
34  unsigned short port_;
35 
36  //bool getNextFragment(void);
37 };
38 
39 }
40 
41 #endif