mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-05-04 16:24:11 +02:00
Added destructor to H5 writer
This commit is contained in:
@@ -53,8 +53,25 @@ HDF5ChunkedWriter::HDF5ChunkedWriter(const std::string filename, const std::stri
|
||||
this->initial_dataset_size = initial_dataset_size;
|
||||
}
|
||||
|
||||
HDF5ChunkedWriter::~HDF5ChunkedWriter()
|
||||
{
|
||||
close_file();
|
||||
}
|
||||
|
||||
void HDF5ChunkedWriter::close_file()
|
||||
{
|
||||
if (file.getId() == -1) {
|
||||
#ifdef DEBUG
|
||||
std::cout << "Trying to close an already closed file." << std::endl;
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
std::cout << "Closing file." << std::endl;
|
||||
#endif
|
||||
|
||||
compact_dataset(dataset, max_frame_index);
|
||||
|
||||
hsize_t min_frame_in_dataset = 0;
|
||||
|
||||
@@ -42,6 +42,7 @@ class HDF5ChunkedWriter
|
||||
|
||||
public:
|
||||
HDF5ChunkedWriter(const std::string filename, const std::string dataset_name, hsize_t frames_per_file=0, hsize_t initial_dataset_size=config::initial_dataset_size);
|
||||
~HDF5ChunkedWriter();
|
||||
void close_file();
|
||||
void write_data(size_t frame_index, size_t* frame_shape, size_t data_bytes_size, char* data);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user