HighFive 2.10.1
HighFive - Header-only C++ HDF5 interface
Loading...
Searching...
No Matches
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#pragma once
10
11#include <vector>
12
13#include "H5DataSpace.hpp"
14#include "H5DataType.hpp"
15#include "H5Object.hpp"
21
22namespace HighFive {
23
27class DataSet: public Object,
28 public SliceTraits<DataSet>,
29 public AnnotateTraits<DataSet>,
30 public PathTraits<DataSet> {
31 public:
33
38 uint64_t getStorageSize() const;
39
44 uint64_t getOffset() const;
45
50 DataType getDataType() const;
51
56 DataSpace getSpace() const;
57
63 DataSpace getMemSpace() const;
64
65
71 void resize(const std::vector<size_t>& dims);
72
73
78 inline std::vector<size_t> getDimensions() const {
79 return getSpace().getDimensions();
80 }
81
87 inline size_t getElementCount() const {
88 return getSpace().getElementCount();
89 }
90
93 return details::get_plist<DataSetCreateProps>(*this, H5Dget_create_plist);
94 }
95
98 return details::get_plist<DataSetAccessProps>(*this, H5Dget_access_plist);
99 }
100
102 H5_DEPRECATED("Default constructor creates unsafe uninitialized objects")
103 DataSet() = default;
104
105 protected:
106 using Object::Object; // bring DataSet(hid_t)
107
108 DataSet(Object&& o) noexcept
109 : Object(std::move(o)) {}
110
111 friend class Reference;
112 template <typename Derivate>
113 friend class NodeTraits;
114};
115
116} // namespace HighFive
#define H5_DEPRECATED(msg)
Definition H5_definitions.hpp:9
Definition H5Annotate_traits.hpp:18
Class representing a dataset.
Definition H5DataSet.hpp:30
DataSpace getMemSpace() const
getMemSpace
Definition H5DataSet_misc.hpp:38
void resize(const std::vector< size_t > &dims)
Change the size of the dataset.
Definition H5DataSet_misc.hpp:46
DataType getDataType() const
getDataType
Definition H5DataSet_misc.hpp:28
DataSetCreateProps getCreatePropertyList() const
Get the list of properties for creation of this dataset.
Definition H5DataSet.hpp:92
uint64_t getOffset() const
getOffset
Definition H5DataSet_misc.hpp:42
uint64_t getStorageSize() const
getStorageSize
Definition H5DataSet_misc.hpp:24
DataSpace getSpace() const
getSpace
Definition H5DataSet_misc.hpp:32
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:87
DataSetAccessProps getAccessPropertyList() const
Get the list of properties for accession of this dataset.
Definition H5DataSet.hpp:97
std::vector< size_t > getDimensions() const
Get the dimensions of the whole DataSet. This is a shorthand for getSpace().getDimensions()
Definition H5DataSet.hpp:78
Class representing the space (dimensions) of a DataSet.
Definition H5DataSpace.hpp:39
size_t getElementCount() const
Return the number of elements in this DataSpace.
Definition H5Dataspace_misc.hpp:112
std::vector< size_t > getDimensions() const
Returns the size of the dataset in each dimension.
Definition H5Dataspace_misc.hpp:104
HDF5 Data Type.
Definition H5DataType.hpp:61
NodeTraits: Base class for Group and File.
Definition H5Node_traits.hpp:28
Definition H5Object.hpp:54
Definition H5Path_traits.hpp:16
HDF5 property Lists.
Definition H5PropertyList.hpp:160
An HDF5 (object) reference type.
Definition H5Reference.hpp:33
Definition H5Slice_traits.hpp:350
Definition H5_definitions.hpp:22
ObjectType
Enum of the types of objects (H5O api)
Definition H5Object.hpp:24