hdf5/ChannelIO.hpp
Go to the documentation of this file.
1 #pragma once
2 #ifndef LVR2_IO_HDF5_CHANNELIO_HPP
3 #define LVR2_IO_HDF5_CHANNELIO_HPP
4 
5 #include <highfive/H5DataSet.hpp>
7 #include <highfive/H5File.hpp>
8 
9 #include "lvr2/types/Channel.hpp"
11 #include "lvr2/io/Timestamp.hpp"
12 
13 // Depending Features
14 
15 namespace lvr2 {
16 
17 namespace hdf5features {
18 
19 template<typename Derived>
20 class ChannelIO : public GroupedChannelIO {
21 public:
22  template<typename T>
23  ChannelOptional<T> load(std::string groupName,
24  std::string datasetName);
25 
26  template<typename T>
28  HighFive::Group& g,
29  std::string datasetName
30  );
31 
32  template<typename T>
33  ChannelOptional<T> loadChannel(std::string groupName,
34  std::string datasetName);
35 
36  template<typename T>
37  void save(std::string groupName,
38  std::string datasetName,
39  const Channel<T>& channel);
40 
41  template<typename T>
42  void save(HighFive::Group& g,
43  std::string datasetName,
44  const Channel<T>& channel);
45 
46  template<typename T>
47  void save(HighFive::Group& g,
48  std::string datasetName,
49  const Channel<T>& channel,
50  std::vector<hsize_t>& chunkSize);
51 
52 protected:
53  Derived* m_file_access = static_cast<Derived*>(this);
54 
55  template <typename T>
56  bool getChannel(const std::string group, const std::string name, boost::optional<AttributeChannel<T>>& channel);
57 
65  virtual bool getChannel(const std::string group, const std::string name, FloatChannelOptional& channel);
66 
74  virtual bool getChannel(const std::string group, const std::string name, IndexChannelOptional& channel);
75 
83  virtual bool getChannel(const std::string group, const std::string name, UCharChannelOptional& channel);
84 
85  template <typename T>
86  bool addChannel(const std::string group, const std::string name, const AttributeChannel<T>& channel);
87 
95  virtual bool addChannel(const std::string group, const std::string name, const FloatChannel& channel);
96 
104  virtual bool addChannel(const std::string group, const std::string name, const IndexChannel& channel);
105 
113  virtual bool addChannel(const std::string group, const std::string name, const UCharChannel& channel);
114 
115 
116 };
117 
118 
119 } // namespace hdf5features
120 
121 } // namespace hdf5features
122 
123 #include "ChannelIO.tcc"
124 
125 #endif
ChannelOptional< T > loadChannel(std::string groupName, std::string datasetName)
UCharChannel::Optional UCharChannelOptional
Definition: Channel.hpp:96
void save(std::string groupName, std::string datasetName, const Channel< T > &channel)
Interface class for io classes that support annotation channels organized in different groups...
FloatChannel::Optional FloatChannelOptional
Definition: Channel.hpp:88
ChannelOptional< T > load(std::string groupName, std::string datasetName)
IndexChannel::Optional IndexChannelOptional
Definition: Channel.hpp:100
typename Channel< T >::Optional ChannelOptional
Definition: Channel.hpp:85
bool addChannel(const std::string group, const std::string name, const AttributeChannel< T > &channel)
bool getChannel(const std::string group, const std::string name, boost::optional< AttributeChannel< T >> &channel)


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:06