From 170d607faf638d70aa83372527355b47d8dba366 Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Fri, 9 Feb 2018 11:36:51 +0100 Subject: [PATCH] Add header value types to format --- src/H5Format.hpp | 15 +++++++++++++++ src/format/NXmxFormat.cpp | 10 ++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/H5Format.hpp b/src/H5Format.hpp index f7024a4..4ad35b5 100644 --- a/src/H5Format.hpp +++ b/src/H5Format.hpp @@ -8,6 +8,19 @@ #include #include +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& get_input_value_type() const = 0; virtual const std::map& get_default_values() const = 0; virtual const h5_group& get_format_definition() const = 0; + virtual const std::map& get_header_value_type() const = 0; + virtual void add_calculated_values(std::map& values) const = 0; virtual void add_input_values(std::map& values, const std::map& input_values) const = 0; diff --git a/src/format/NXmxFormat.cpp b/src/format/NXmxFormat.cpp index a1b52f0..45ae921 100644 --- a/src/format/NXmxFormat.cpp +++ b/src/format/NXmxFormat.cpp @@ -14,6 +14,7 @@ class NXmxFormat : public H5Format shared_ptr> input_value_type = NULL; shared_ptr> default_values = NULL; shared_ptr file_format = NULL; + shared_ptr> header_value_type = NULL; public: ~NXmxFormat(){}; @@ -93,6 +94,11 @@ class NXmxFormat : public H5Format {"samz", NX_FLOAT}, })); + header_value_type.reset( + new map({ + {"pulse_id", UINT64 }, + })); + // Default values used in the file format. default_values.reset(new std::map( { @@ -1056,4 +1062,8 @@ class NXmxFormat : public H5Format return *input_value_type; } + const std::map& get_header_value_type() const override { + return *header_value_type; + } + }; \ No newline at end of file