mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-05-06 03:24:14 +02:00
31 lines
657 B
C++
31 lines
657 B
C++
#ifndef BUFFERMULTIREADER_H
|
|
#define BUFFERMULTIREADER_H
|
|
|
|
#include <thread>
|
|
#include "RingBuffer.hpp"
|
|
|
|
class BufferMultiReader
|
|
{
|
|
const std::string root_folder_;
|
|
std::atomic_bool is_running_;
|
|
uint16_t* frame_buffer_;
|
|
UdpFrameMetadata* frame_metadata_buffer_;
|
|
|
|
std::atomic_uint n_modules_left_;
|
|
std::atomic_uint64_t pulse_id_;
|
|
std::vector<std::thread> receiving_threads_;
|
|
|
|
protected:
|
|
void read_thread(uint8_t module_number);
|
|
|
|
public:
|
|
BufferMultiReader(const std::string& root_folder);
|
|
|
|
virtual ~BufferMultiReader();
|
|
|
|
char* get_buffer();
|
|
|
|
UdpFrameMetadata load_frame_to_buffer(const uint64_t pulse_id);
|
|
};
|
|
|
|
#endif |