mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-05-03 18:54:12 +02:00
30 lines
635 B
C++
30 lines
635 B
C++
#ifndef BUFFERMULTIREADER_H
|
|
#define BUFFERMULTIREADER_H
|
|
|
|
#include <thread>
|
|
#include "RingBuffer.hpp"
|
|
|
|
class BufferMultiReader
|
|
{
|
|
const std::string device_name;
|
|
const std::string root_folder;
|
|
|
|
std::atomic_bool is_running_;
|
|
std::atomic_int n_modules_left_;
|
|
std::atomic_uint64_t pulse_id_;
|
|
std::vector<std::thread> receiving_threads_;
|
|
|
|
protected:
|
|
void read_thread();
|
|
|
|
public:
|
|
BufferMultiReader(
|
|
const std::string& device_name,
|
|
const std::string& root_folder);
|
|
|
|
virtual ~BufferMultiReader();
|
|
|
|
UdpFrameMetadata get_frame(const uint64_t pulse_id, void* frame_buffer);
|
|
};
|
|
|
|
#endif |