Add flush metadata to close method

This commit is contained in:
2020-04-19 23:40:01 +02:00
parent 8805c6a923
commit c37d4b8aa2
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -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();
};
+2 -1
View 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();
}