9 #ifndef H5DATASET_MISC_HPP
10 #define H5DATASET_MISC_HPP
19 #include <boost/multi_array.hpp>
22 #include <H5Dpublic.h>
23 #include <H5Ppublic.h>
25 #include "../H5DataSet.hpp"
26 #include "../H5DataSpace.hpp"
27 #include "../H5DataType.hpp"
37 return H5Dget_storage_size(
_hid);
48 if ((space.
_hid = H5Dget_space(
_hid)) < 0) {
49 HDF5ErrMapper::ToException<DataSetException>(
50 "Unable to get DataSpace out of DataSet");
58 haddr_t addr = H5Dget_offset(
_hid);
59 if (addr == HADDR_UNDEF) {
60 HDF5ErrMapper::ToException<DataSetException>(
61 "Cannot get offset of DataSet.");
69 if (dims.size() != numDimensions) {
70 HDF5ErrMapper::ToException<DataSetException>(
71 "Invalid dataspace dimensions, got " + std::to_string(dims.size()) +
72 " expected " + std::to_string(numDimensions));
75 std::vector<hsize_t> real_dims(dims.begin(), dims.end());
77 if (H5Dset_extent(
getId(), real_dims.data()) < 0) {
78 HDF5ErrMapper::ToException<DataSetException>(
79 "Could not resize dataset.");
85 #endif // H5DATASET_MISC_HPP