tdaq-develop-2025-02-12
TCPDataListenerProducer.h
1 #ifndef _ots_TCPDataListenerProducer_h_
2 #define _ots_TCPDataListenerProducer_h_
3 
4 #include "otsdaq/Configurable/Configurable.h"
5 #include "otsdaq/DataManager/DataProducer.h"
6 #include "otsdaq/NetworkUtilities/TCPListenServer.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 TCPListenServer
17 {
18  public:
19  TCPDataListenerProducer(std::string supervisorApplicationUID,
20  std::string bufferUID,
21  std::string processorUID,
22  const ConfigurationTree& theXDAQContextConfigTree,
23  const std::string& configurationPath);
24  virtual ~TCPDataListenerProducer(void);
25  virtual void startProcessingData(std::string runNumber) override;
26  virtual void stopProcessingData(void) override;
27 
28  protected:
29  bool workLoopThread(toolbox::task::WorkLoop* workLoop) override;
30  void slowWrite(void);
31  void fastWrite(void);
33  std::string data_;
34  std::map<std::string, std::string> header_;
36  std::string* dataP_;
37  std::map<std::string, std::string>* headerP_;
38 
39  std::string dataType_;
40  unsigned port_;
41 
42  // bool getNextFragment(void);
43 };
44 
45 } // namespace ots
46 
47 #endif
std::string data_
For slow write.
bool workLoopThread(toolbox::task::WorkLoop *workLoop) override
bool TCPDataListenerProducer::getNextFragment(void)
std::string * dataP_
For fast write.