Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-19 08:55:34

0001 #pragma once
0002 
0003 #include <H5Rpublic.h>
0004 
0005 namespace HighFive {
0006 namespace detail {
0007 inline herr_t h5r_create(void* ref,
0008                          hid_t loc_id,
0009                          const char* name,
0010                          H5R_type_t ref_type,
0011                          hid_t space_id) {
0012     herr_t err = H5Rcreate(ref, loc_id, name, ref_type, space_id);
0013     if (err < 0) {
0014         HDF5ErrMapper::ToException<ReferenceException>(
0015             std::string("Unable to create the reference for \"") + name + "\":");
0016     }
0017 
0018     return err;
0019 }
0020 
0021 #if (H5Rdereference_vers == 2)
0022 inline hid_t h5r_dereference(hid_t obj_id, hid_t oapl_id, H5R_type_t ref_type, const void* ref) {
0023     hid_t hid = H5Rdereference(obj_id, oapl_id, ref_type, ref);
0024     if (hid < 0) {
0025         HDF5ErrMapper::ToException<ReferenceException>("Unable to dereference.");
0026     }
0027 
0028     return hid;
0029 }
0030 #else
0031 inline hid_t h5r_dereference(hid_t dataset, H5R_type_t ref_type, const void* ref) {
0032     hid_t hid = H5Rdereference(dataset, ref_type, ref);
0033     if (hid < 0) {
0034         HDF5ErrMapper::ToException<ReferenceException>("Unable to dereference.");
0035     }
0036 
0037     return hid;
0038 }
0039 #endif
0040 
0041 }  // namespace detail
0042 }  // namespace HighFive