9 #ifndef H5DATASET_MISC_HPP
10 #define H5DATASET_MISC_HPP
19 #include <boost/multi_array.hpp>
22 #include <H5Dpublic.h>
23 #include <H5Ppublic.h>
30 return H5Dget_storage_size(
_hid);
39 if ((space.
_hid = H5Dget_space(
_hid)) < 0) {
40 HDF5ErrMapper::ToException<DataSetException>(
41 "Unable to get DataSpace out of DataSet");
51 uint64_t addr = H5Dget_offset(
_hid);
52 if (addr == HADDR_UNDEF) {
53 HDF5ErrMapper::ToException<DataSetException>(
54 "Cannot get offset of DataSet.");
62 if (dims.size() != numDimensions) {
63 HDF5ErrMapper::ToException<DataSetException>(
64 "Invalid dataspace dimensions, got " + std::to_string(dims.size()) +
65 " expected " + std::to_string(numDimensions));
68 std::vector<hsize_t> real_dims(dims.begin(), dims.end());
70 if (H5Dset_extent(
getId(), real_dims.data()) < 0) {
71 HDF5ErrMapper::ToException<DataSetException>(
72 "Could not resize dataset.");
DataSpace getMemSpace() const
getMemSpace
Definition: H5DataSet_misc.hpp:46
void resize(const std::vector< size_t > &dims)
Change the size of the dataset.
Definition: H5DataSet_misc.hpp:59
DataType getDataType() const
getDataType
Definition: H5DataSet_misc.hpp:33
uint64_t getOffset() const
getOffset
Definition: H5DataSet_misc.hpp:50
uint64_t getStorageSize() const
getStorageSize
Definition: H5DataSet_misc.hpp:29
DataSpace getSpace() const
getSpace
Definition: H5DataSet_misc.hpp:37
Class representing the space (dimensions) of a dataset.
Definition: H5DataSpace.hpp:37
std::vector< size_t > getDimensions() const
getDimensions
Definition: H5Dataspace_misc.hpp:103
HDF5 Data Type.
Definition: H5DataType.hpp:42
hid_t getId() const noexcept
getId
Definition: H5Object_misc.hpp:55
hid_t _hid
Definition: H5Object.hpp:87
Definition: H5_definitions.hpp:15