Add header value types to format

This commit is contained in:
2018-02-09 11:36:51 +01:00
parent e81a73f121
commit 170d607faf
2 changed files with 25 additions and 0 deletions
+15
View File
@@ -8,6 +8,19 @@
#include <memory>
#include <boost/any.hpp>
enum HEADER_DATA_TYPE
{
UINT8,
UINT16,
UINT32,
UINT64,
INT8,
INT16,
INT32,
INT64,
FLOAT32,
FLOAT64
};
typedef boost::any h5_value;
@@ -87,6 +100,8 @@ class H5Format
virtual const std::map<std::string, DATA_TYPE>& get_input_value_type() const = 0;
virtual const std::map<std::string, boost::any>& get_default_values() const = 0;
virtual const h5_group& get_format_definition() const = 0;
virtual const std::map<std::string, HEADER_DATA_TYPE>& get_header_value_type() const = 0;
virtual void add_calculated_values(std::map<std::string, boost::any>& values) const = 0;
virtual void add_input_values(std::map<std::string, boost::any>& values, const std::map<std::string, boost::any>& input_values) const = 0;
+10
View File
@@ -14,6 +14,7 @@ class NXmxFormat : public H5Format
shared_ptr<map<string, DATA_TYPE>> input_value_type = NULL;
shared_ptr<map<string, boost::any>> default_values = NULL;
shared_ptr<h5_group> file_format = NULL;
shared_ptr<map<string, HEADER_DATA_TYPE>> header_value_type = NULL;
public:
~NXmxFormat(){};
@@ -93,6 +94,11 @@ class NXmxFormat : public H5Format
{"samz", NX_FLOAT},
}));
header_value_type.reset(
new map<string, HEADER_DATA_TYPE>({
{"pulse_id", UINT64 },
}));
// Default values used in the file format.
default_values.reset(new std::map<string, boost::any>(
{
@@ -1056,4 +1062,8 @@ class NXmxFormat : public H5Format
return *input_value_type;
}
const std::map<string, HEADER_DATA_TYPE>& get_header_value_type() const override {
return *header_value_type;
}
};