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
lvr2::IndexChannelOptional
IndexChannel::Optional IndexChannelOptional
Definition: Channel.hpp:100
lvr2::UCharChannelOptional
UCharChannel::Optional UCharChannelOptional
Definition: Channel.hpp:96
lvr2::GroupedChannelIO
Interface class for io classes that support annotation channels organized in different groups.
Definition: descriptions/GroupedChannelIO.hpp:42
H5File.hpp
GroupedChannelIO.hpp
lvr2::hdf5features::ChannelIO::loadChannel
ChannelOptional< T > loadChannel(std::string groupName, std::string datasetName)
lvr2::FloatChannelOptional
FloatChannel::Optional FloatChannelOptional
Definition: Channel.hpp:88
lvr2::hdf5features::ChannelIO::m_file_access
Derived * m_file_access
Definition: hdf5/ChannelIO.hpp:53
H5DataSet.hpp
H5DataSpace.hpp
lvr2::hdf5features::ChannelIO::addChannel
bool addChannel(const std::string group, const std::string name, const AttributeChannel< T > &channel)
lvr2::hdf5features::ChannelIO::save
void save(std::string groupName, std::string datasetName, const Channel< T > &channel)
lvr2::ChannelOptional
typename Channel< T >::Optional ChannelOptional
Definition: Channel.hpp:85
Channel.hpp
HighFive::Group
Definition: H5Group.hpp:20
lvr2::hdf5features::ChannelIO::getChannel
bool getChannel(const std::string group, const std::string name, boost::optional< AttributeChannel< T >> &channel)
lvr2::Channel
Definition: Channel.hpp:42
lvr2
Definition: BaseBufferManipulators.hpp:39
Timestamp.hpp
lvr2::hdf5features::ChannelIO::load
ChannelOptional< T > load(std::string groupName, std::string datasetName)
lvr2::hdf5features::ChannelIO
Definition: hdf5/ChannelIO.hpp:20


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 Wed Mar 2 2022 00:37:23