hdf5/VariantChannelIO.hpp
Go to the documentation of this file.
1 #pragma once
2 #ifndef LVR2_IO_HDF5_VARIANTCHANNELIO_HPP
3 #define LVR2_IO_HDF5_VARIANTCHANNELIO_HPP
4 
5 #include <highfive/H5DataSet.hpp>
7 #include <highfive/H5File.hpp>
8 
9 // Object to store
12 
13 // Dependencies
14 #include "ChannelIO.hpp"
15 
16 namespace lvr2 {
17 
18 namespace hdf5features {
19 
54 struct ConstructType {
55 
56 };
57 
58 template<typename Derived = ConstructType>
60 public:
61 
62  template<typename ...Tp>
63  void save(std::string groupName, std::string datasetName, const VariantChannel<Tp...>& vchannel);
64 
65  template<typename ...Tp>
66  void save(HighFive::Group& group, std::string datasetName, const VariantChannel<Tp...>& vchannel);
67 
68  template<typename VariantChannelT>
69  boost::optional<VariantChannelT> load(std::string groupName, std::string datasetName);
70 
71  template<typename VariantChannelT>
72  boost::optional<VariantChannelT> load(HighFive::Group& group, std::string datasetName);
73 
74  template<typename VariantChannelT>
75  boost::optional<VariantChannelT> loadVariantChannel(std::string groupName, std::string datasetName);
76 
77 protected:
78 
79  template<typename VariantChannelT>
80  boost::optional<VariantChannelT> loadDynamic(HighFive::DataType dtype,
81  HighFive::Group& group,
82  std::string name);
83 
84  template<typename ...Tp>
85  void saveDynamic(HighFive::Group& group,
86  std::string datasetName,
87  const VariantChannel<Tp...>& vchannel
88  );
89 
90  Derived* m_file_access = static_cast<Derived*>(this);
91  ChannelIO<Derived>* m_channel_io = static_cast<ChannelIO<Derived>*>(m_file_access);
92 };
93 
94 } // hdf5features
95 
99 template<typename BaseIO>
100 struct Hdf5Construct<hdf5features::VariantChannelIO, BaseIO> {
101 
102  // DEPS
104 
105  // add actual feature
106  using type = typename deps::template add_features<hdf5features::VariantChannelIO>::type;
107 };
108 
109 
110 
111 
112 // generator
113 
114 } // namespace lvr2
115 
116 #include "VariantChannelIO.tcc"
117 
118 #endif // LVR2_IO_HDF5_VARIANTCHANNELIO_HPP
Hdf5IO Feature for handling VariantChannel related IO.
Interface specification for low-level io. All read elements are stored in linear arrays.
Definition: BaseIO.hpp:57
Helper class how to construct a IO feature with its dependencies.
typename Hdf5Construct< hdf5features::ChannelIO, BaseIO >::type deps
HDF5 Data Type.
Definition: H5DataType.hpp:21
Hdf5IO Feature for handling VariantChannel related IO.
typename Derived::template add_features< Feature >::type type
typename deps::template add_features< hdf5features::VariantChannelIO >::type type


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Mon Feb 28 2022 22:46:09