diff --git a/src/H5ChunkedWriter.cpp b/src/H5ChunkedWriter.cpp index 86f386f..81888c1 100644 --- a/src/H5ChunkedWriter.cpp +++ b/src/H5ChunkedWriter.cpp @@ -1,4 +1,4 @@ -#include +#include "h5_utils.hpp" #include #include #include @@ -11,46 +11,6 @@ extern "C" using namespace std; -hsize_t expand_dataset(const H5::DataSet& dataset, hsize_t frame_index, hsize_t dataset_increase_step) -{ - hsize_t dataset_rank = 3; - hsize_t dataset_dimension[dataset_rank]; - - dataset.getSpace().getSimpleExtentDims(dataset_dimension); - dataset_dimension[0] = frame_index + dataset_increase_step; - - #ifdef DEBUG_OUTPUT - cout << "[expand_dataset] Expanding dataspace to size ("; - for (hsize_t i=0; i current_dataset_size) { - current_dataset_size = expand_dataset(dataset, relative_frame_index, config::dataset_increase_step); + current_dataset_size = h5_utils::expand_dataset(dataset, relative_frame_index, config::dataset_increase_step); } // Keep track of the max index in this file - needed for shrinking the dataset at the end. diff --git a/src/h5_utils.cpp b/src/h5_utils.cpp index 3a4f802..a565013 100644 --- a/src/h5_utils.cpp +++ b/src/h5_utils.cpp @@ -7,6 +7,46 @@ using namespace std; +hsize_t h5_utils::expand_dataset(const H5::DataSet& dataset, hsize_t frame_index, hsize_t dataset_increase_step) +{ + hsize_t dataset_rank = 3; + hsize_t dataset_dimension[dataset_rank]; + + dataset.getSpace().getSimpleExtentDims(dataset_dimension); + dataset_dimension[0] = frame_index + dataset_increase_step; + + #ifdef DEBUG_OUTPUT + cout << "[expand_dataset] Expanding dataspace to size ("; + for (hsize_t i=0; i& values);