1#ifndef RITSUKO_HDF5_VLS_OPEN_HPP
2#define RITSUKO_HDF5_VLS_OPEN_HPP
41inline H5::DataSet
open_pointers(
const H5::Group& handle,
const char* name,
size_t offset_precision,
size_t length_precision) {
43 if (dhandle.getTypeClass() != H5T_COMPOUND) {
44 throw std::runtime_error(
"expected a compound datatype for a VLS pointer dataset at '" +
get_name(dhandle) +
"'");
48 }
catch (std::exception& e) {
49 throw std::runtime_error(
"incorrect type for VLS pointer dataset at '" +
get_name(dhandle) +
"; " + std::string(e.what()));
71inline H5::DataSet
open_heap(
const H5::Group& handle,
const char* name) {
73 if (dhandle.getTypeClass() != H5T_INTEGER) {
74 throw std::runtime_error(
"expected an integer datatype for the VLS heap at '" +
get_name(dhandle) +
"'");
77 throw std::runtime_error(
"expected 8-bit unsigned integers for the VLS heap at '" +
get_name(dhandle) +
"'");
79 if (dhandle.getSpace().getSimpleExtentNdims() != 1) {
80 throw std::runtime_error(
"expected a 1-dimensional dataset for the VLS heap at '" +
get_name(dhandle) +
"'");
Compound datatype for the VLS heap pointer.
Get the name of a HDF5 object.
H5::DataSet open_heap(const H5::Group &handle, const char *name)
Definition open.hpp:71
void validate_pointer_datatype(const H5::CompType &type, size_t offset_precision, size_t length_precision)
Definition Pointer.hpp:85
H5::DataSet open_pointers(const H5::Group &handle, const char *name, size_t offset_precision, size_t length_precision)
Definition open.hpp:41
std::string get_name(const Handle_ &handle)
Definition get_name.hpp:24
H5::DataSet open_dataset(const H5::Group &handle, const char *name)
Definition open.hpp:72
bool exceeds_integer_limit(const H5::IntType &itype, size_t precision, bool is_signed)
Definition exceeds_limit.hpp:27
Assorted helper functions for parsing and validation.
Definition choose_missing_placeholder.hpp:15
Convenience functions to safely open HDF5 handles.