38 #include "config_hdf5.h"
44 #include "InternalErr.h"
49 HDF5Url::HDF5Url(
const string &n,
const string &vpath,
const string &d) : Url(n, d),var_path(vpath)
61 hid_t file_id = H5Fopen(dataset().c_str(),H5F_ACC_RDONLY,H5P_DEFAULT);
63 throw InternalErr(__FILE__,__LINE__,
"Fail to obtain the HDF5 file ID .");
68 dset_id = H5Dopen2(file_id,var_path.c_str(),H5P_DEFAULT);
70 dset_id = H5Dopen2(file_id,name().c_str(),H5P_DEFAULT);
75 throw InternalErr(__FILE__,__LINE__,
"Fail to obtain the datatype .");
80 if (H5Dread(dset_id, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT,
84 throw InternalErr(__FILE__, __LINE__,
"H5Dread() failed.");
87 hid_t did_r = H5RDEREFERENCE(dset_id, H5R_OBJECT, &rbuf);
92 throw InternalErr(__FILE__, __LINE__,
"H5RDEREFERENCE() failed.");
97 throw InternalErr(__FILE__, __LINE__,
"Unable to retrieve the name of the object.");
99 string reference = r_name;
100 set_value(reference);