mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-04-20 21:54:36 +02:00
37 lines
753 B
C++
37 lines
753 B
C++
#ifndef BINARYWRITER_HPP
|
|
#define BINARYWRITER_HPP
|
|
|
|
#include <string>
|
|
|
|
#include "formats.hpp"
|
|
|
|
class BufferBinaryWriter {
|
|
|
|
const size_t MAX_FILE_BYTES =
|
|
buffer_config::FILE_MOD * sizeof(BufferBinaryFormat);
|
|
|
|
const std::string detector_folder_;
|
|
const std::string module_name_;
|
|
std::string latest_filename_;
|
|
|
|
std::string current_output_filename_;
|
|
int output_file_fd_;
|
|
|
|
void open_file(const std::string& filename);
|
|
void close_current_file();
|
|
|
|
|
|
public:
|
|
BufferBinaryWriter(
|
|
const std::string& detector_folder,
|
|
const std::string& module_name);
|
|
|
|
virtual ~BufferBinaryWriter();
|
|
|
|
void write(const uint64_t pulse_id, const BufferBinaryFormat* buffer);
|
|
|
|
};
|
|
|
|
|
|
#endif //BINARYWRITER_HPP
|