artdaq_core  v1_05_07
 All Classes Namespaces Functions
SimpleQueueReader.hh
1 #ifndef artdaq_core_Core_SimpleQueueReader_hh
2 #define artdaq_core_Core_SimpleQueueReader_hh
3 
4 #include "artdaq-core/Core/GlobalQueue.hh"
5 #include <thread>
6 #include <memory>
7 
8 namespace artdaq {
9  // simpleQueueReaderApp is a function that can be used in place of
10  // artapp(), to read RawEvents from the shared RawEvent queue.
11  // Note that it ignores both of its arguments.
12  int simpleQueueReaderApp(int, char **);
13 
14  // SimpleQueueReader will continue to read RawEvents off the queue
15  // until it encounters a null pointer, at which point it stops.
17  public:
18  explicit SimpleQueueReader(std::size_t eec = 0);
19  void run();
20 
21  private:
22  RawEventQueue & queue_;
23  std::size_t expectedEventCount_;
24  };
25 }
26 
27 #endif /* artdaq_core_Core_SimpleQueueReader_hh */