From 89760a66416341600f160f962fcdffcea689b789 Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Wed, 17 Jan 2018 08:58:13 +0100 Subject: [PATCH] Temp add format functions to h5_utils --- src/h5_utils.cpp | 12 +++++++++++- src/h5_utils.hpp | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/h5_utils.cpp b/src/h5_utils.cpp index 8bbc9be..5b3d479 100644 --- a/src/h5_utils.cpp +++ b/src/h5_utils.cpp @@ -226,7 +226,7 @@ void h5_utils::write_attribute(H5::H5Object& target, h5_attr& attribute, map& values){ +void h5_utils::write_format_data(H5::CommonFG& file_node, h5_parent& format_node, std::map& 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& 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); } \ No newline at end of file diff --git a/src/h5_utils.hpp b/src/h5_utils.hpp index 30631ce..53ff599 100644 --- a/src/h5_utils.hpp +++ b/src/h5_utils.hpp @@ -8,6 +8,7 @@ #include #include + 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& values); void write_format_data(H5::CommonFG& file_node, h5_parent& format_node, std::map& values); -} + void write_format(H5::H5File& file, std::map& input_values); +}; + +std::map* get_input_value_type(); +std::map* get_default_values(); +h5_group* get_format_definition(); +void add_calculated_values(std::map& values); +void add_input_values(std::map& values, std::map& input_values); + + #endif \ No newline at end of file