mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-05-02 16:24:13 +02:00
Temp add format functions to h5_utils
This commit is contained in:
+11
-1
@@ -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
@@ -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
|
||||
Reference in New Issue
Block a user