H5PropertyList.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c), 2017-2018, Adrien Devresse <adrien.devresse@epfl.ch>
3  * Juan Hernando <juan.hernando@epfl.ch>
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 H5PROPERTY_LIST_HPP
10 #define H5PROPERTY_LIST_HPP
11 
12 #include "H5Object.hpp"
13 
14 #include <H5Ppublic.h>
15 
16 namespace HighFive {
17 
21 class Properties {
22  public:
23  enum Type
24  {
28  };
29 
30  ~Properties();
31 
32 #ifdef H5_USE_CXX11
33  Properties(Properties&& other);
35 #endif
36 
37  Type getType() const { return _type; }
38 
39  hid_t getId() const { return _hid; }
40 
46  template <typename Property>
47  void add(const Property& property);
48 
49  protected:
50 
51  // protected constructor
52  explicit Properties(Type type);
53 
54  private:
55 #ifdef H5_USE_CXX11
56  Properties(const Properties&) = delete;
57  Properties& operator=(const Properties&) = delete;
58 #else
59  Properties(const Properties&);
61 #endif
62 
64  hid_t _hid;
65 };
66 
68 public:
70 };
71 
73 public:
75 };
76 
77 class Chunking
78 {
79  public:
80  Chunking(const std::vector<hsize_t>& dims) : _dims(dims) {}
81 
82  Chunking(std::initializer_list<hsize_t> items) : Chunking(std::vector<hsize_t>{items}) {}
83 
84  template<typename... Args>
85  Chunking(hsize_t item, Args... args) : Chunking(std::vector<hsize_t>{item, static_cast<hsize_t>(args)...}) {}
86 
87  const std::vector<hsize_t>& getDimensions() const {return _dims;}
88 
89  private:
90  friend class Properties;
91  void apply(hid_t hid) const;
92  const std::vector<hsize_t> _dims;
93 };
94 
95 class Deflate
96 {
97  public:
98  Deflate(int level) : _level(level) {}
99 
100  private:
101  friend class Properties;
102  void apply(hid_t hid) const;
103  const int _level;
104 };
105 
106 class Shuffle
107 {
108  public:
109  Shuffle() {}
110 
111  private:
112  friend class Properties;
113  void apply(hid_t hid) const;
114 };
115 
118 class Caching
119 {
120  public:
123  Caching(const size_t numSlots, const size_t cacheSize,
124  const double w0 = H5D_CHUNK_CACHE_W0_DEFAULT)
125  : _numSlots(numSlots)
126  , _cacheSize(cacheSize)
127  , _w0(w0)
128  {}
129 
130  private:
131  friend class Properties;
132  void apply(hid_t hid) const;
133  const unsigned int _numSlots;
134  const size_t _cacheSize;
135  const double _w0;
136 };
137 
138 } // HighFive
139 
141 
142 #endif // H5PROPERTY_LIST_HPP
void add(const Property &property)
const size_t _cacheSize
Chunking(const std::vector< hsize_t > &dims)
Chunking(std::initializer_list< hsize_t > items)
Chunking(hsize_t item, Args... args)
Generic HDF5 property List.
Properties(Properties &&other)
const std::vector< hsize_t > _dims
const unsigned int _numSlots
Caching(const size_t numSlots, const size_t cacheSize, const double w0=H5D_CHUNK_CACHE_W0_DEFAULT)
Properties & operator=(Properties &&other)
const std::vector< hsize_t > & getDimensions() const


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