Temp add format functions to h5_utils

This commit is contained in:
2018-01-17 08:58:13 +01:00
parent f704ca5d37
commit 89760a6641
2 changed files with 22 additions and 2 deletions
+11 -1
View File
@@ -226,7 +226,7 @@ void h5_utils::write_attribute(H5::H5Object& target, h5_attr& attribute, map<str
}
}
void h5_utils::write_format_data(H5::CommonFG& file_node, h5_parent& format_node, std::map<std::string, h5_value>& values){
void h5_utils::write_format_data(H5::CommonFG& file_node, h5_parent& format_node, std::map<std::string, h5_value>& values) {
auto node_group = h5_utils::create_group(file_node, format_node.name);
for (auto item : format_node.items) {
@@ -259,4 +259,14 @@ void h5_utils::write_format_data(H5::CommonFG& file_node, h5_parent& format_node
}
}
}
}
void h5_utils::write_format(H5::H5File& file, std::map<std::string, h5_value>& input_values){
auto format = get_format_definition();
auto values = get_default_values();
add_input_values(*values, input_values);
add_calculated_values(*values);
write_format_data(file, *format, *values);
}
+11 -1
View File
@@ -8,6 +8,7 @@
#include <boost/any.hpp>
#include <H5Cpp.h>
typedef boost::any h5_value;
enum NODE_TYPE {
@@ -84,6 +85,15 @@ namespace h5_utils{
boost::any get_value_from_reference(std::string& dataset_name, boost::any value_reference, std::map<std::string, boost::any>& values);
void write_format_data(H5::CommonFG& file_node, h5_parent& format_node, std::map<std::string, h5_value>& values);
}
void write_format(H5::H5File& file, std::map<std::string, h5_value>& input_values);
};
std::map<std::string, DATA_TYPE>* get_input_value_type();
std::map<std::string, boost::any>* get_default_values();
h5_group* get_format_definition();
void add_calculated_values(std::map<std::string, boost::any>& values);
void add_input_values(std::map<std::string, boost::any>& values, std::map<std::string, boost::any>& input_values);
#endif