otsdaq  v2_05_02_indev
DataProcessor.h
1 #ifndef _ots_DataProcessor_h_
2 #define _ots_DataProcessor_h_
3 
4 #include <string>
5 #include "otsdaq/DataManager/CircularBuffer.h"
6 #include "otsdaq/DataManager/CircularBufferBase.h"
7 #include "otsdaq/WorkLoopManager/WorkLoop.h"
8 
9 namespace ots
10 {
11 // DataProcessor
12 // This class provides common functionality for Data Producers and Consumers.
14 {
15  public:
16  DataProcessor(std::string supervisorApplicationUID, std::string bufferUID, std::string processorUID);
17  virtual ~DataProcessor(void);
18 
19  virtual void registerToBuffer(void) = 0;
20  // virtual void unregisterFromBuffer(void) = 0;
21 
22  virtual void startProcessingData(std::string runNumber) = 0;
23  virtual void stopProcessingData(void) = 0;
24  virtual void pauseProcessingData(void) { stopProcessingData(); }
25  virtual void resumeProcessingData(void) { startProcessingData(""); }
26 
27  // Getters
28  const std::string& getProcessorID(void) const { return processorUID_; }
29 
30  void setCircularBuffer(CircularBufferBase* circularBuffer);
31 
32  protected:
33  const std::string supervisorApplicationUID_;
34  const std::string bufferUID_;
35  const std::string processorUID_;
36  CircularBufferBase* theCircularBuffer_;
37 };
38 
39 } // namespace ots
40 
41 #endif