hops
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
HighFive::ObjectType::Dataset
@ Dataset
HighFive::DataSet::getDataType
DataType getDataType() const
getDataType
Definition: H5DataSet_misc.hpp:39
HighFive::Reference
An HDF5 (object) reference type.
Definition: H5Reference.hpp:31
H5Object.hpp
HighFive::AnnotateTraits
Definition: H5_definitions.hpp:39
HighFive::DataSet::getPath
std::string getPath() const
return the path to the current dataset
Definition: H5DataSet_misc.hpp:29
H5Slice_traits.hpp
HighFive::DataSpace::getDimensions
std::vector< size_t > getDimensions() const
getDimensions
Definition: H5Dataspace_misc.hpp:99
HighFive::DataType
HDF5 Data Type.
Definition: H5DataType.hpp:42
HighFive::DataSet::getOffset
uint64_t getOffset() const
getOffset
Definition: H5DataSet_misc.hpp:56
HighFive::DataSet::type
const static ObjectType type
Definition: H5DataSet.hpp:32
HighFive::DataSet::DataSet
DataSet(Object &&o) noexcept
Definition: H5DataSet.hpp:99
HighFive::SliceTraits
Definition: H5Slice_traits.hpp:54
HighFive::DataSet::getMemSpace
DataSpace getMemSpace() const
getMemSpace
Definition: H5DataSet_misc.hpp:52
HighFive::Object
Definition: H5Object.hpp:36
H5DataSpace.hpp
HighFive::NodeTraits
NodeTraits: Base class for Group and File.
Definition: H5_definitions.hpp:45
H5DataType.hpp
HighFive::DataSet::getDimensions
std::vector< size_t > getDimensions() const
Get the dimensions of the whole DataSet. This is a shorthand for getSpace().getDimensions()
Definition: H5DataSet.hpp:83
HighFive::ObjectType
ObjectType
Enum of the types of objects (H5O api)
Definition: H5Object.hpp:25
HighFive::DataSet::getSpace
DataSpace getSpace() const
getSpace
Definition: H5DataSet_misc.hpp:43
HighFive::DataSet::getStorageSize
uint64_t getStorageSize() const
getStorageSize
Definition: H5DataSet_misc.hpp:35
H5Annotate_traits.hpp
HighFive::DataSpace::getElementCount
size_t getElementCount() const
getElementCount
Definition: H5Dataspace_misc.hpp:110
HighFive::DataSet::resize
void resize(const std::vector< size_t > &dims)
Change the size of the dataset.
Definition: H5DataSet_misc.hpp:65
HighFive::DataSpace
Class representing the space (dimensions) of a dataset.
Definition: H5DataSpace.hpp:37
HighFive::Object::Object
Object()
Definition: H5Object_misc.hpp:16
string
NAME string(REPLACE ".cpp" "_bin" example_name ${example_filename}) if($
Definition: hops/Third-party/HighFive/src/examples/CMakeLists.txt:6
HighFive::DataSet::getElementCount
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
HighFive::DataSet
Class representing a dataset.
Definition: H5DataSet.hpp:27
HighFive
Definition: H5_definitions.hpp:15
H5_definitions.hpp