H5Slice_traits.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c), 2017, Adrien Devresse <adrien.devresse@epfl.ch>
3  *
4  * Distributed under the Boost Software License, Version 1.0.
5  * (See accompanying file LICENSE_1_0.txt or copy at
6  * http://www.boost.org/LICENSE_1_0.txt)
7  *
8  */
9 #ifndef H5SLICE_TRAITS_HPP
10 #define H5SLICE_TRAITS_HPP
11 
12 #include <cstdlib>
13 #include <vector>
14 
15 #include "H5Utils.hpp"
16 
17 namespace HighFive {
18 
19 class DataSet;
20 class Group;
21 class DataSpace;
22 class DataType;
23 class Selection;
24 
25 template <typename Derivate>
27 
28 class ElementSet {
29  public:
30  explicit ElementSet(const std::vector<std::size_t>& element_ids);
31 
32  private:
33  std::vector<std::size_t> _ids;
34 
35  template <typename Derivate>
36  friend class SliceTraits;
37 };
38 
39 template <typename Derivate>
40 class SliceTraits {
41  public:
48  Selection select(const std::vector<size_t>& offset,
49  const std::vector<size_t>& count,
50  const std::vector<size_t>& stride = std::vector<size_t>())
51  const;
52 
57  Selection select(const std::vector<size_t>& columns) const;
58 
62  Selection select(const ElementSet& elements) const;
63 
73  template <typename T>
74  void read(T& array) const;
75 
82  template <typename T>
83  void read(T* array) const;
84 
92  template <typename T>
93  void write(const T& buffer);
94 
102  template <typename T>
103  void write(const T* buffer);
104 
105  private:
106  typedef Derivate derivate_type;
107 };
108 }
109 
110 #endif // H5SLICE_TRAITS_HPP
std::vector< std::size_t > _ids
ElementSet(const std::vector< std::size_t > &element_ids)
Selection: represent a view on a slice/part of a dataset.
Definition: H5Selection.hpp:27


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