HighFive  2.2.2
HighFive - Header-only C++ HDF5 interface
H5DataSet.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 H5DATASET_HPP
10 #define H5DATASET_HPP
11 
12 #include <vector>
13 
14 #include "H5DataSpace.hpp"
15 #include "H5DataType.hpp"
16 #include "H5Object.hpp"
17 #include "bits/H5_definitions.hpp"
19 #include "bits/H5Slice_traits.hpp"
20 #include "bits/H5_definitions.hpp"
21 
22 namespace HighFive {
23 
27 class DataSet : public Object,
28  public SliceTraits<DataSet>,
29  public AnnotateTraits<DataSet> {
30  public:
31 
33 
37  std::string getPath() const;
38 
43  uint64_t getStorageSize() const;
44 
49  uint64_t getOffset() const;
50 
55  DataType getDataType() const;
56 
61  DataSpace getSpace() const;
62 
68  DataSpace getMemSpace() const;
69 
70 
76  void resize(const std::vector<size_t>& dims);
77 
78 
83  inline std::vector<size_t> getDimensions() const {
84  return getSpace().getDimensions();
85  }
86 
92  inline size_t getElementCount() const {
93  return getSpace().getElementCount();
94  }
95 
96  protected:
97  using Object::Object;
98 
99  inline DataSet(Object&& o) noexcept : Object(std::move(o)) {}
100 
101  friend class Reference;
102  template <typename Derivate> friend class NodeTraits;
103 
104 };
105 
106 } // namespace HighFive
107 
108 #endif // H5DATASET_HPP
Definition: H5Annotate_traits.hpp:19
Class representing a dataset.
Definition: H5DataSet.hpp:29
DataSpace getMemSpace() const
getMemSpace
Definition: H5DataSet_misc.hpp:52
void resize(const std::vector< size_t > &dims)
Change the size of the dataset.
Definition: H5DataSet_misc.hpp:65
DataType getDataType() const
getDataType
Definition: H5DataSet_misc.hpp:39
uint64_t getOffset() const
getOffset
Definition: H5DataSet_misc.hpp:56
Object()
Definition: H5Object_misc.hpp:16
DataSet(Object &&o) noexcept
Definition: H5DataSet.hpp:99
uint64_t getStorageSize() const
getStorageSize
Definition: H5DataSet_misc.hpp:35
std::string getPath() const
return the path to the current dataset
Definition: H5DataSet_misc.hpp:29
DataSpace getSpace() const
getSpace
Definition: H5DataSet_misc.hpp:43
static const ObjectType type
Definition: H5DataSet.hpp:32
size_t getElementCount() const
Get the total number of elements in the current dataset. E.g. 2x2x2 matrix has size 8....
Definition: H5DataSet.hpp:92
std::vector< size_t > getDimensions() const
Get the dimensions of the whole DataSet. This is a shorthand for getSpace().getDimensions()
Definition: H5DataSet.hpp:83
Class representing the space (dimensions) of a dataset.
Definition: H5DataSpace.hpp:37
size_t getElementCount() const
getElementCount
Definition: H5Dataspace_misc.hpp:110
std::vector< size_t > getDimensions() const
getDimensions
Definition: H5Dataspace_misc.hpp:99
HDF5 Data Type.
Definition: H5DataType.hpp:42
NodeTraits: Base class for Group and File.
Definition: H5Node_traits.hpp:23
Definition: H5Object.hpp:36
Object()
Definition: H5Object_misc.hpp:16
An HDF5 (object) reference type.
Definition: H5Reference.hpp:31
Definition: H5Slice_traits.hpp:54
Definition: H5_definitions.hpp:15
ObjectType
Enum of the types of objects (H5O api)
Definition: H5Object.hpp:25