HighFive 2.10.0
HighFive - Header-only C++ HDF5 interface
Loading...
Searching...
No Matches
h5r_wrapper.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <H5Rpublic.h>
4
5namespace HighFive {
6namespace detail {
7inline herr_t h5r_create(void* ref,
8 hid_t loc_id,
9 const char* name,
10 H5R_type_t ref_type,
11 hid_t space_id) {
12 herr_t err = H5Rcreate(ref, loc_id, name, ref_type, space_id);
13 if (err < 0) {
15 std::string("Unable to create the reference for \"") + name + "\":");
16 }
17
18 return err;
19}
20
21#if (H5Rdereference_vers == 2)
22inline hid_t h5r_dereference(hid_t obj_id, hid_t oapl_id, H5R_type_t ref_type, const void* ref) {
23 hid_t hid = H5Rdereference(obj_id, oapl_id, ref_type, ref);
24 if (hid < 0) {
25 HDF5ErrMapper::ToException<ReferenceException>("Unable to dereference.");
26 }
27
28 return hid;
29}
30#else
31inline hid_t h5r_dereference(hid_t dataset, H5R_type_t ref_type, const void* ref) {
32 hid_t hid = H5Rdereference(dataset, ref_type, ref);
33 if (hid < 0) {
34 HDF5ErrMapper::ToException<ReferenceException>("Unable to dereference.");
35 }
36
37 return hid;
38}
39#endif
40
41} // namespace detail
42} // namespace HighFive
Definition H5_definitions.hpp:22
static void ToException(const std::string &prefix_msg)
Definition H5Exception_misc.hpp:43