From 94edf9cf8be8eb2fe8990db39c3c07c4a38bd71b Mon Sep 17 00:00:00 2001 From: Antonin Portelli Date: Fri, 20 Apr 2018 17:13:21 +0100 Subject: [PATCH] HDF5: direct access to group for custom operations --- lib/serialisation/Hdf5IO.cc | 10 ++++++++++ lib/serialisation/Hdf5IO.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/lib/serialisation/Hdf5IO.cc b/lib/serialisation/Hdf5IO.cc index 1fb7be0c..b915a988 100644 --- a/lib/serialisation/Hdf5IO.cc +++ b/lib/serialisation/Hdf5IO.cc @@ -55,6 +55,11 @@ void Hdf5Writer::writeDefault(const std::string &s, const char *x) writeDefault(s, sx); } +Group & Hdf5Writer::getGroup(void) +{ + return group_; +} + // Reader implementation /////////////////////////////////////////////////////// Hdf5Reader::Hdf5Reader(const std::string &fileName) : fileName_(fileName) @@ -103,3 +108,8 @@ void Hdf5Reader::readDefault(const std::string &s, std::string &x) x.resize(strType.getSize()); attribute.read(strType, &(x[0])); } + +Group & Hdf5Reader::getGroup(void) +{ + return group_; +} diff --git a/lib/serialisation/Hdf5IO.h b/lib/serialisation/Hdf5IO.h index 12625ab8..1ae2791e 100644 --- a/lib/serialisation/Hdf5IO.h +++ b/lib/serialisation/Hdf5IO.h @@ -38,6 +38,7 @@ namespace Grid template typename std::enable_if>::is_number, void>::type writeDefault(const std::string &s, const std::vector &x); + H5NS::Group & getGroup(void); private: template void writeSingleAttribute(const U &x, const std::string &name, @@ -65,6 +66,7 @@ namespace Grid template typename std::enable_if>::is_number, void>::type readDefault(const std::string &s, std::vector &x); + H5NS::Group & getGroup(void); private: template void readSingleAttribute(U &x, const std::string &name,