Go to the documentation of this file.
9 #ifndef H5DATASET_MISC_HPP
10 #define H5DATASET_MISC_HPP
19 #include <boost/multi_array.hpp>
22 #include <H5Dpublic.h>
23 #include <H5Ppublic.h>
31 return H5Iget_name(
_hid, buffer, length);
36 return H5Dget_storage_size(
_hid);
45 if ((space.
_hid = H5Dget_space(
_hid)) < 0) {
46 HDF5ErrMapper::ToException<DataSetException>(
47 "Unable to get DataSpace out of DataSet");
57 uint64_t addr = H5Dget_offset(
_hid);
58 if (addr == HADDR_UNDEF) {
59 HDF5ErrMapper::ToException<DataSetException>(
60 "Cannot get offset of DataSet.");
68 if (dims.size() != numDimensions) {
69 HDF5ErrMapper::ToException<DataSetException>(
70 "Invalid dataspace dimensions, got " + std::to_string(dims.size()) +
71 " expected " + std::to_string(numDimensions));
74 std::vector<hsize_t> real_dims(dims.begin(), dims.end());
76 if (H5Dset_extent(
getId(), real_dims.data()) < 0) {
77 HDF5ErrMapper::ToException<DataSetException>(
78 "Could not resize dataset.");
84 #endif // H5DATASET_MISC_HPP
DataType getDataType() const
getDataType
Definition: H5DataSet_misc.hpp:39
std::string get_name(T fct)
Definition: H5Utils.hpp:252
std::string getPath() const
return the path to the current dataset
Definition: H5DataSet_misc.hpp:29
std::vector< size_t > getDimensions() const
getDimensions
Definition: H5Dataspace_misc.hpp:99
HDF5 Data Type.
Definition: H5DataType.hpp:42
uint64_t getOffset() const
getOffset
Definition: H5DataSet_misc.hpp:56
DataSpace getMemSpace() const
getMemSpace
Definition: H5DataSet_misc.hpp:52
hid_t getId() const noexcept
getId
Definition: H5Object_misc.hpp:55
DataSpace getSpace() const
getSpace
Definition: H5DataSet_misc.hpp:43
uint64_t getStorageSize() const
getStorageSize
Definition: H5DataSet_misc.hpp:35
void resize(const std::vector< size_t > &dims)
Change the size of the dataset.
Definition: H5DataSet_misc.hpp:65
hid_t _hid
Definition: H5Object.hpp:81
Class representing the space (dimensions) of a dataset.
Definition: H5DataSpace.hpp:37
NAME string(REPLACE ".cpp" "_bin" example_name ${example_filename}) if($
Definition: hops/Third-party/HighFive/src/examples/CMakeLists.txt:6
Definition: H5_definitions.hpp:15