From 1c6ee1a8d573cd14126aca64268ab0b65469f70d Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Wed, 24 Jan 2018 13:53:22 +0100 Subject: [PATCH] Increase HDF5 library version --- conda-recipe/meta.yaml | 2 +- src/H5Format.cpp | 20 ++++++++++---------- src/H5Format.hpp | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index 0ce8c7d..e67d348 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -13,7 +13,7 @@ requirements: - make - gcc - cppzmq =4.2.1 - - hdf5 =1.8.17 + - hdf5 =1.10.1 - boost =1.61.0 run: diff --git a/src/H5Format.cpp b/src/H5Format.cpp index c3f3faf..2f619d6 100644 --- a/src/H5Format.cpp +++ b/src/H5Format.cpp @@ -47,9 +47,9 @@ void H5Format::compact_dataset(const H5::DataSet& dataset, hsize_t max_frame_ind dataset.extend(dataset_dimension); } -H5::Group H5Format::create_group(H5::CommonFG& target, std::string name) +H5::Group H5Format::create_group(H5::Group& target, std::string name) { - return target.createGroup(name); + return target.createGroup(name.c_str()); } boost::any H5Format::get_value_from_reference(string& dataset_name, boost::any value_reference, map& values) @@ -167,7 +167,7 @@ H5::DataSet H5Format::write_dataset(H5::Group& target, string name, double value H5::DataSpace att_space(H5S_SCALAR); auto data_type = H5::PredType::NATIVE_DOUBLE; - H5::DataSet dataset = target.createDataSet(name, data_type , att_space); + H5::DataSet dataset = target.createDataSet(name.c_str(), data_type , att_space); dataset.write(&value, data_type); return dataset; @@ -178,7 +178,7 @@ H5::DataSet H5Format::write_dataset(H5::Group& target, string name, int value) H5::DataSpace att_space(H5S_SCALAR); auto data_type = H5::PredType::NATIVE_INT; - H5::DataSet dataset = target.createDataSet(name, data_type, att_space); + H5::DataSet dataset = target.createDataSet(name.c_str(), data_type, att_space); dataset.write(&value, data_type); return dataset; @@ -189,7 +189,7 @@ H5::DataSet H5Format::write_dataset(H5::Group& target, string name, string value H5::DataSpace att_space(H5S_SCALAR); H5::DataType data_type = H5::StrType(0, H5T_VARIABLE); - H5::DataSet dataset = target.createDataSet(name, data_type ,att_space); + H5::DataSet dataset = target.createDataSet(name.c_str(), data_type ,att_space); dataset.write(&value, data_type); return dataset; @@ -198,10 +198,10 @@ H5::DataSet H5Format::write_dataset(H5::Group& target, string name, string value void H5Format::write_attribute(H5::H5Object& target, string name, string value) { H5::DataSpace att_space(H5S_SCALAR); - H5::DataType data_type = H5::StrType(0, H5T_VARIABLE); + H5::DataType data_type = H5::StrType(H5::PredType::C_S1, H5T_VARIABLE); - auto h5_attribute = target.createAttribute(name, data_type, att_space); - h5_attribute.write(data_type, value); + auto h5_attribute = target.createAttribute(name.c_str(), data_type, att_space); + h5_attribute.write(data_type, &value); } void H5Format::write_attribute(H5::H5Object& target, string name, int value) @@ -209,7 +209,7 @@ void H5Format::write_attribute(H5::H5Object& target, string name, int value) H5::DataSpace att_space(H5S_SCALAR); auto data_type = H5::PredType::NATIVE_INT; - auto h5_attribute = target.createAttribute(name, data_type, att_space); + auto h5_attribute = target.createAttribute(name.c_str(), data_type, att_space); h5_attribute.write(data_type, &value); } @@ -259,7 +259,7 @@ void H5Format::write_attribute(H5::H5Object& target, h5_attr& attribute, map& values) { +void H5Format::write_format_data(H5::Group& file_node, h5_parent& format_node, std::map& values) { auto node_group = H5Format::create_group(file_node, format_node.name); for (auto item : format_node.items) { diff --git a/src/H5Format.hpp b/src/H5Format.hpp index e449608..16167f8 100644 --- a/src/H5Format.hpp +++ b/src/H5Format.hpp @@ -70,7 +70,7 @@ namespace H5Format { 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); - H5::Group create_group(H5::CommonFG& target, std::string name); + H5::Group create_group(H5::Group& target, std::string name); H5::PredType get_dataset_data_type(std::string& type); H5::DataSet write_dataset(H5::Group& target, h5_dataset& dataset, std::map& values); @@ -84,7 +84,7 @@ namespace H5Format { boost::any get_value_from_reference(std::string& dataset_name, boost::any value_reference, std::map& values); - void write_format_data(H5::CommonFG& file_node, h5_parent& format_node, std::map& values); + void write_format_data(H5::Group& file_node, h5_parent& format_node, std::map& values); void write_format(H5::H5File& file, std::map& input_values); };