Add format to ChunkedWriter

This commit is contained in:
2018-01-12 16:26:00 +01:00
parent 8f33097969
commit 17642c8ee8
2 changed files with 12 additions and 9 deletions
+6 -9
View File
@@ -4,6 +4,7 @@
#include <iostream>
#include "H5ChunkedWriter.hpp"
#include "h5_file_format.hpp"
extern "C"
{
@@ -102,15 +103,8 @@ void HDF5ChunkedWriter::close_file()
cout << "[HDF5ChunkedWriter::close_file] Setting dataset attribute image_nr_low=" << image_nr_low << " and image_nr_high=" << image_nr_high << endl;
#endif
// H5::IntType int_type(H5::PredType::NATIVE_UINT32);
// H5::DataSpace att_space(H5S_SCALAR);
// auto low_index_attribute = dataset.createAttribute("image_nr_low", int_type, att_space);
// H5::IntType int_type(H5::PredType::NATIVE_UINT32);
// H5::DataSpace att_space(H5S_SCALAR);
// auto high_index_attribute = dataset.createAttribute("image_nr_high", int_type, att_space);
// TODO: Populate additional h5 attributes.
h5_utils::write_attribute(dataset, "image_nr_low", image_nr_low);
h5_utils::write_attribute(dataset, "image_nr_high", image_nr_high);
// Cleanup.
file.close();
@@ -234,3 +228,6 @@ hsize_t HDF5ChunkedWriter::prepare_storage_for_frame(size_t frame_index, size_t*
return relative_frame_index;
}
void HDF5ChunkedWriter::write_format(h5_base& format_root, std::map<std::string, h5_value>& values) {
}
+6
View File
@@ -1,12 +1,17 @@
#ifndef H5CHUNKEDWRITER_H
#define H5CHUNKEDWRITER_H
#include <map>
#include "config.hpp"
#include "h5_file_format.hpp"
#include <boost/any.hpp>
hsize_t expand_dataset(const H5::DataSet& dataset, hsize_t frame_index, hsize_t dataset_increase_step);
void compact_dataset(const H5::DataSet& dataset, hsize_t max_frame_index);
typedef boost::any h5_value;
class HDF5ChunkedWriter
{
// Initialized in constructor.
@@ -34,6 +39,7 @@ class HDF5ChunkedWriter
~HDF5ChunkedWriter();
void close_file();
void write_data(size_t frame_index, size_t* frame_shape, size_t data_bytes_size, char* data);
void write_format(h5_base& format_root, std::map<std::string, h5_value>& values);
};
#endif