mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-04-21 02:14:36 +02:00
33 lines
624 B
C++
33 lines
624 B
C++
#ifndef BINARYWRITER_HPP
|
|
#define BINARYWRITER_HPP
|
|
|
|
#include <string>
|
|
#include "JFFileFormat.hpp"
|
|
|
|
class BinaryWriter {
|
|
|
|
const std::string device_name_;
|
|
const std::string root_folder_;
|
|
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:
|
|
BinaryWriter(
|
|
const std::string& device_name,
|
|
const std::string& root_folder);
|
|
|
|
virtual ~BinaryWriter();
|
|
|
|
void write(const uint64_t pulse_id, const JFFileFormat* buffer);
|
|
|
|
};
|
|
|
|
|
|
#endif //BINARYWRITER_HPP
|