mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-05-03 11:34:12 +02:00
Add flush metadata to close method
This commit is contained in:
@@ -32,7 +32,7 @@ class FastH5Writer {
|
||||
std::unordered_map<std::string, H5::PredType> scalar_metadata_;
|
||||
|
||||
void create_file(const std::string& filename);
|
||||
void close_file();
|
||||
|
||||
|
||||
void flush_metadata();
|
||||
|
||||
@@ -55,6 +55,7 @@ public:
|
||||
const void* value,
|
||||
const size_t value_n_bytes);
|
||||
|
||||
void close_file();
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -75,6 +75,8 @@ void FastH5Writer::create_file(const string& filename)
|
||||
|
||||
void FastH5Writer::close_file()
|
||||
{
|
||||
flush_metadata();
|
||||
|
||||
current_output_filename_ = "";
|
||||
current_output_file_.close();
|
||||
current_image_dataset_.close();
|
||||
@@ -100,7 +102,6 @@ void FastH5Writer::set_pulse_id(const uint64_t pulse_id)
|
||||
if (new_output_filename != current_output_filename_){
|
||||
|
||||
if (current_output_file_.getId() != -1) {
|
||||
flush_metadata();
|
||||
close_file();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user