41#include "config_hdf5.h"
43#include <libdap/InternalErr.h>
46#include <libdap/mime_util.h>
95bool depth_first(hid_t pid,
char *gname, D4Group* par_grp,
const char *fname)
98 ">depth_first() for dmr "
100 <<
" gname: " << gname
101 <<
" fname: " << fname
111 if(H5Gget_info(pid,&g_info) <0) {
113 "h5_dmr handler: counting hdf5 group elements error for ";
115 throw InternalErr(__FILE__, __LINE__, msg);
118 nelems = g_info.nlinks;
120 ssize_t oname_size = 0;
123 for (hsize_t i = 0; i < nelems; i++) {
129 H5Lget_name_by_idx(pid,
".",H5_INDEX_NAME,H5_ITER_NATIVE,i,
nullptr,
131 if (oname_size <= 0) {
132 string msg =
"h5_dmr handler: Error getting the size of the hdf5 object from the group: ";
134 throw InternalErr(__FILE__, __LINE__, msg);
138 oname.resize((
size_t) oname_size + 1);
140 if (H5Lget_name_by_idx(pid,
".",H5_INDEX_NAME,H5_ITER_NATIVE,i,oname.data(),
141 (
size_t)(oname_size+1), H5P_DEFAULT) < 0){
143 "h5_dmr handler: Error getting the hdf5 object name from the group: ";
145 throw InternalErr(__FILE__, __LINE__, msg);
150 if (H5Lget_info(pid,oname.data(),&linfo,H5P_DEFAULT)<0) {
151 string msg =
"hdf5 link name error from: ";
153 throw InternalErr(__FILE__, __LINE__, msg);
157 if(linfo.type == H5L_TYPE_SOFT) {
159 size_t val_size = linfo.u.val_size;
160 get_softlink(par_grp,pid,oname.data(),slinkindex,val_size);
166 if(linfo.type == H5L_TYPE_EXTERNAL)
172 if (H5OGET_INFO_BY_IDX(pid,
".", H5_INDEX_NAME, H5_ITER_NATIVE,
173 i, &oinfo, H5P_DEFAULT)<0) {
174 string msg =
"h5_dmr handler: Error obtaining the info for the object";
175 msg += string(oname.begin(),oname.end());
176 throw InternalErr(__FILE__, __LINE__, msg);
179 H5O_type_t obj_type = oinfo.type;
187 string full_path_name =
188 string(gname) + string(oname.begin(),oname.end()-1) +
"/";
190 BESDEBUG(
"h5",
"=depth_first dmr ():H5G_GROUP " << full_path_name
194 t_fpn.resize(full_path_name.length()+1);
195 copy(full_path_name.begin(),full_path_name.end(),t_fpn.begin());
196 t_fpn[full_path_name.length()] =
'\0';
198 hid_t cgroup = H5Gopen(pid, t_fpn.data(),H5P_DEFAULT);
200 throw InternalErr(__FILE__, __LINE__,
"h5_dmr handler: H5Gopen() failed.");
203 string grp_name = string(oname.begin(),oname.end()-1);
206 string oid = get_hardlink_dmr(cgroup, full_path_name.c_str());
209 D4Group* tem_d4_cgroup =
new D4Group(grp_name);
215 par_grp->add_group_nocopy(tem_d4_cgroup);
219 depth_first(cgroup, t_fpn.data(), tem_d4_cgroup,fname);
230 D4Group* tem_d4_cgroup =
new D4Group(
string(grp_name));
233 D4Attribute *d4_hlinfo =
new D4Attribute(
"HDF5_HARDLINK",attr_str_c);
236 tem_d4_cgroup->attributes()->add_attribute_nocopy(d4_hlinfo);
237 par_grp->add_group_nocopy(tem_d4_cgroup);
241 if (H5Gclose(cgroup) < 0){
242 throw InternalErr(__FILE__, __LINE__,
"Could not close the group.");
247 case H5O_TYPE_DATASET:
251 string full_path_name = string(gname) + string(oname.begin(),oname.end()-1);
264 if((dset_id = H5Dopen(pid,full_path_name.c_str(),H5P_DEFAULT)) <0) {
265 string msg =
"cannot open the HDF5 dataset ";
266 msg += full_path_name;
267 throw InternalErr(__FILE__, __LINE__, msg);
277 if(H5Dclose(dset_id)<0) {
278 string msg =
"cannot close the HDF5 dataset ";
279 msg += full_path_name;
280 throw InternalErr(__FILE__, __LINE__, msg);
285 case H5O_TYPE_NAMED_DATATYPE:
293 BESDEBUG(
"h5",
"<depth_first() for dmr" << endl);
321bool breadth_first(
const hid_t file_id, hid_t pid,
const char *gname, D4Group* par_grp,
const char *fname,
bool use_dimscale,vector<link_info_t> & hdf5_hls )
324 ">breadth_first() for dmr "
326 <<
" gname: " << gname
327 <<
" fname: " << fname
336 if(H5Gget_info(pid,&g_info) <0) {
338 "h5_dmr handler: counting hdf5 group elements error for ";
340 throw InternalErr(__FILE__, __LINE__, msg);
343 nelems = g_info.nlinks;
348 for (hsize_t i = 0; i < nelems; i++) {
354 H5Lget_name_by_idx(pid,
".",H5_INDEX_NAME,H5_ITER_NATIVE,i,
nullptr,
356 if (oname_size <= 0) {
357 string msg =
"h5_dmr handler: Error getting the size of the hdf5 object from the group: ";
359 throw InternalErr(__FILE__, __LINE__, msg);
363 oname.resize((
size_t) oname_size + 1);
365 if (H5Lget_name_by_idx(pid,
".",H5_INDEX_NAME,H5_ITER_NATIVE,i,oname.data(),
366 (
size_t)(oname_size+1), H5P_DEFAULT) < 0){
368 "h5_dmr handler: Error getting the hdf5 object name from the group: ";
370 throw InternalErr(__FILE__, __LINE__, msg);
375 if (H5Lget_info(pid,oname.data(),&linfo,H5P_DEFAULT)<0) {
376 string msg =
"hdf5 link name error from: ";
378 throw InternalErr(__FILE__, __LINE__, msg);
382 if(linfo.type == H5L_TYPE_SOFT) {
386 size_t val_size = linfo.u.val_size;
387 get_softlink(par_grp,pid,oname.data(),slinkindex,val_size);
392 if(linfo.type == H5L_TYPE_EXTERNAL)
398 if (H5OGET_INFO_BY_IDX(pid,
".", H5_INDEX_NAME, H5_ITER_NATIVE,
399 i, &oinfo, H5P_DEFAULT)<0) {
400 string msg =
"h5_dmr handler: Error obtaining the info for the object";
401 msg += string(oname.begin(),oname.end());
402 throw InternalErr(__FILE__, __LINE__, msg);
405 H5O_type_t obj_type = oinfo.type;
407 if(H5O_TYPE_DATASET == obj_type) {
410 string full_path_name = string(gname) + string(oname.begin(),oname.end()-1);
417 bool is_pure_dim =
false;
418 get_dataset_dmr(file_id, pid, full_path_name, &dt_inst,use_dimscale,is_pure_dim,hdf5_hls);
420 if(
false == is_pure_dim) {
422 if((dset_id = H5Dopen(pid,full_path_name.c_str(),H5P_DEFAULT)) <0) {
423 string msg =
"cannot open the HDF5 dataset ";
424 msg += full_path_name;
425 throw InternalErr(__FILE__, __LINE__, msg);
435 if(H5Dclose(dset_id)<0) {
436 string msg =
"cannot close the HDF5 dataset ";
437 msg += full_path_name;
438 throw InternalErr(__FILE__, __LINE__, msg);
443 D4Dimensions *d4_dims = par_grp->dims();
444 auto d4dim_name = string(oname.begin(),oname.end()-1);
445 D4Dimension *d4_dim = d4_dims->find_dim(d4dim_name);
446 if(d4_dim ==
nullptr) {
447 d4_dim =
new D4Dimension(d4dim_name,dt_inst.
nelmts);
448 d4_dims->add_dim_nocopy(d4_dim);
450 BESDEBUG(
"h5",
"<h5dmr.cc: pure dimension: dataset name." << d4dim_name << endl);
451 if(H5Tclose(dt_inst.
type)<0) {
452 throw InternalErr(__FILE__, __LINE__,
"Cannot close the HDF5 datatype.");
463 for (hsize_t i = 0; i < nelems; i++) {
469 H5Lget_name_by_idx(pid,
".",H5_INDEX_NAME,H5_ITER_NATIVE,i,
nullptr,
471 if (oname_size <= 0) {
472 string msg =
"h5_dmr handler: Error getting the size of the hdf5 object from the group: ";
474 throw InternalErr(__FILE__, __LINE__, msg);
478 oname.resize((
size_t) oname_size + 1);
480 if (H5Lget_name_by_idx(pid,
".",H5_INDEX_NAME,H5_ITER_NATIVE,i,oname.data(),
481 (
size_t)(oname_size+1), H5P_DEFAULT) < 0){
483 "h5_dmr handler: Error getting the hdf5 object name from the group: ";
485 throw InternalErr(__FILE__, __LINE__, msg);
490 if (H5Lget_info(pid,oname.data(),&linfo,H5P_DEFAULT)<0) {
491 string msg =
"hdf5 link name error from: ";
493 throw InternalErr(__FILE__, __LINE__, msg);
498 if(linfo.type == H5L_TYPE_SOFT) {
503 if(linfo.type == H5L_TYPE_EXTERNAL)
509 if (H5OGET_INFO_BY_IDX(pid,
".", H5_INDEX_NAME, H5_ITER_NATIVE,
510 i, &oinfo, H5P_DEFAULT)<0) {
511 string msg =
"h5_dmr handler: Error obtaining the info for the object in the breadth_first.";
512 throw InternalErr(__FILE__, __LINE__, msg);
515 H5O_type_t obj_type = oinfo.type;
518 if(obj_type == H5O_TYPE_GROUP) {
521 string full_path_name =
522 string(gname) + string(oname.begin(),oname.end()-1) +
"/";
524 BESDEBUG(
"h5",
"=breadth_first dmr ():H5G_GROUP " << full_path_name
528 t_fpn.resize(full_path_name.length()+1);
529 copy(full_path_name.begin(),full_path_name.end(),t_fpn.begin());
530 t_fpn[full_path_name.length()] =
'\0';
532 hid_t cgroup = H5Gopen(pid, t_fpn.data(),H5P_DEFAULT);
534 throw InternalErr(__FILE__, __LINE__,
"h5_dmr handler: H5Gopen() failed.");
537 auto grp_name = string(oname.begin(),oname.end()-1);
540 string oid = get_hardlink_dmr(cgroup, full_path_name.c_str());
543 auto tem_d4_cgroup =
new D4Group(grp_name);
546 par_grp->add_group_nocopy(tem_d4_cgroup);
549 breadth_first(file_id,cgroup, t_fpn.data(), tem_d4_cgroup,fname,use_dimscale,hdf5_hls);
560 D4Group* tem_d4_cgroup =
new D4Group(
string(grp_name));
563 D4Attribute *d4_hlinfo =
new D4Attribute(
"HDF5_HARDLINK",attr_str_c);
566 tem_d4_cgroup->attributes()->add_attribute_nocopy(d4_hlinfo);
567 par_grp->add_group_nocopy(tem_d4_cgroup);
570 if (H5Gclose(cgroup) < 0){
571 throw InternalErr(__FILE__, __LINE__,
"Could not close the group.");
576 BESDEBUG(
"h5",
"<breadth_first() " << endl);
597read_objects( D4Group * d4_grp,
const string &varname,
const string &filename,
const hid_t dset_id)
600 switch (H5Tget_class(dt_inst.
type)) {
608 H5Tclose(dt_inst.
type);
609 throw InternalErr(__FILE__, __LINE__,
"Currently don't support accessing data of Array datatype when array datatype is not inside the compound.");
616 if(H5Tclose(dt_inst.
type)<0) {
617 throw InternalErr(__FILE__, __LINE__,
"Cannot close the HDF5 datatype.");
641 const string & filename,hid_t dset_id)
645 string newvarname = HDF5CFUtil::obtain_string_after_lastslash(varname);
649 BaseType *bt = Get_bt(newvarname, varname,filename, dt_inst.
type,
true);
652 InternalErr(__FILE__, __LINE__,
653 "Unable to convert hdf5 datatype to dods basetype");
657 if (dt_inst.
ndims == 0) {
659 bt->transform_to_dap4(d4_grp,d4_grp);
662 BaseType* new_var = d4_grp->var(bt->name());
667 map_h5_dset_hardlink_to_d4(dset_id,varname,new_var,
nullptr,1);
675 auto ar =
new HDF5Array(newvarname, filename, bt);
676 delete bt; bt =
nullptr;
680 ar->set_memneed(dt_inst.
need);
681 ar->set_numdim(dt_inst.
ndims);
682 ar->set_numelm((
int) (dt_inst.
nelmts));
683 ar->set_varpath(varname);
687 int dimnames_size = 0;
688 if((
unsigned int)((
int)(dt_inst.dimnames.size())) != dt_inst.dimnames.size())
692 InternalErr(__FILE__, __LINE__,
693 "number of dimensions: overflow");
695 dimnames_size = (
int)(dt_inst.dimnames.size());
701 if(dimnames_size ==dt_inst.
ndims) {
703 for (
int dim_index = 0; dim_index < dt_inst.
ndims; dim_index++) {
704 if(dt_inst.dimnames[dim_index] !=
"")
705 ar->append_dim(dt_inst.
size[dim_index],dt_inst.dimnames[dim_index]);
707 ar->append_dim(dt_inst.
size[dim_index]);
710 dt_inst.dimnames.clear();
714 for (
int dim_index = 0; dim_index < dt_inst.
ndims; dim_index++)
715 ar->append_dim(dt_inst.
size[dim_index]);
719 BaseType* new_var =
nullptr;
721 new_var = ar->h5dims_transform_to_dap4(d4_grp,dt_inst.dimnames_path);
729 dt_inst.dimnames_path.clear();
735 map_h5_dset_hardlink_to_d4(dset_id,varname,new_var,
nullptr,1);
738 D4Attribute *test_attr =
new D4Attribute(
"DAP4_test",attr_str_c);
739 test_attr->add_value(
"test_grp_attr");
740 new_var->attributes()->add_attribute_nocopy(test_attr);
743 d4_grp->add_var_nocopy(new_var);
744 delete ar; ar =
nullptr;
746 BESDEBUG(
"h5",
"<read_objects_base_type(dmr)" << endl);
765 const string & filename,hid_t dset_id)
768 string newvarname = HDF5CFUtil::obtain_string_after_lastslash(varname);
771 Structure *structure = Get_structure(newvarname, varname,filename, dt_inst.
type,
true);
774 BESDEBUG(
"h5",
"=read_objects_structure(): Dimension is "
775 << dt_inst.
ndims << endl);
777 if (dt_inst.
ndims != 0) {
778 BESDEBUG(
"h5",
"=read_objects_structure(): array of size " <<
780 BESDEBUG(
"h5",
"=read_objects_structure(): memory needed = " <<
781 dt_inst.
need << endl);
784 auto ar =
new HDF5Array(newvarname, filename, structure);
785 delete structure; structure =
nullptr;
789 ar->set_memneed(dt_inst.
need);
790 ar->set_numdim(dt_inst.
ndims);
791 ar->set_numelm((
int) (dt_inst.
nelmts));
792 ar->set_length((
int) (dt_inst.
nelmts));
793 ar->set_varpath(varname);
796 int dimnames_size = 0;
797 if((
unsigned int)((
int)(dt_inst.dimnames.size())) != dt_inst.dimnames.size())
801 InternalErr(__FILE__, __LINE__,
802 "number of dimensions: overflow");
804 dimnames_size = (
int)(dt_inst.dimnames.size());
807 if(dimnames_size ==dt_inst.
ndims) {
808 for (
int dim_index = 0; dim_index < dt_inst.
ndims; dim_index++) {
809 if(dt_inst.dimnames[dim_index] !=
"")
810 ar->append_dim(dt_inst.
size[dim_index],dt_inst.dimnames[dim_index]);
812 ar->append_dim(dt_inst.
size[dim_index]);
814 dt_inst.dimnames.clear();
817 for (
int dim_index = 0; dim_index < dt_inst.
ndims; dim_index++)
818 ar->append_dim(dt_inst.
size[dim_index]);
823 BaseType* new_var = ar->h5dims_transform_to_dap4(d4_grp,dt_inst.dimnames_path);
824 dt_inst.dimnames_path.clear();
830 map_h5_dset_hardlink_to_d4(dset_id,varname,new_var,
nullptr,1);
834 d4_grp->add_var_nocopy(new_var);
835 delete ar; ar =
nullptr;
839 structure->set_is_dap4(
true);
841 map_h5_dset_hardlink_to_d4(dset_id,varname,
nullptr,structure,2);
843 d4_grp->add_var_nocopy(structure);
872 if (H5OGET_INFO(h5_objid, &obj_info) <0) {
873 string msg =
"Fail to obtain the HDF5 object info. .";
874 throw InternalErr(__FILE__, __LINE__, msg);
878 auto num_attr = (
int)(obj_info.num_attrs);
880 string msg =
"Fail to get the number of attributes for the HDF5 object. ";
881 throw InternalErr(__FILE__, __LINE__,msg);
885 vector<char>temp_buf;
887 bool ignore_attr =
false;
889 for (
int j = 0; j < num_attr; j++) {
897 attr_id =
get_attr_info(h5_objid, j,
true,&attr_inst, &ignore_attr);
898 if (
true == ignore_attr) {
908 hid_t ty_id = H5Aget_type(attr_id);
911 throw InternalErr(__FILE__, __LINE__,
"Cannot retrieve HDF5 attribute datatype successfully.");
917 D4AttributeType dap4_attr_type = daptype_strrep_to_dap4_attrtype(dap_type);
920 if(attr_null_c == dap4_attr_type) {
923 throw InternalErr(__FILE__, __LINE__,
"unsupported DAP4 attribute type");
926 string attr_name = attr_inst.
name;
927 BESDEBUG(
"h5",
"arttr_name= " << attr_name << endl);
930 auto d4_attr =
new D4Attribute(attr_name,dap4_attr_type);
933 if (H5Tis_variable_str(ty_id))
934 write_vlen_str_attrs(attr_id,ty_id,&attr_inst,d4_attr,
nullptr,
true);
941 value.resize(attr_inst.
need);
942 BESDEBUG(
"h5",
"arttr_inst.need=" << attr_inst.
need << endl);
945 hid_t memtype = H5Tget_native_type(ty_id, H5T_DIR_ASCEND);
947 if (H5Aread(attr_id, memtype, (
void *) (value.data())) < 0) {
949 throw InternalErr(__FILE__, __LINE__,
"unable to read HDF5 attribute data");
954 if (attr_inst.
ndims == 0) {
955 for (
int loc = 0; loc < (
int) attr_inst.
nelmts; loc++) {
956 print_rep =
print_attr(ty_id, loc, value.data());
957 if (print_rep.c_str() !=
nullptr) {
958 d4_attr->add_value(print_rep);
966 int elesize = (
int) H5Tget_size(ty_id);
971 throw InternalErr(__FILE__, __LINE__,
"unable to get attibute size");
976 char *tempvalue = value.data();
980 for( hsize_t temp_index = 0; temp_index < attr_inst.
nelmts; temp_index ++) {
982 if (print_rep.c_str() !=
nullptr) {
984 BESDEBUG(
"h5",
"print_rep= " << print_rep << endl);
986 d4_attr->add_value(print_rep);
987 tempvalue = tempvalue + elesize;
989 "tempvalue= " << tempvalue
990 <<
"elesize=" << elesize
998 throw InternalErr(__FILE__, __LINE__,
"unable to convert attibute value to DAP");
1003 if(H5Tclose(ty_id) < 0) {
1006 throw InternalErr(__FILE__, __LINE__,
"unable to close HDF5 type id");
1008 if (H5Aclose(attr_id) < 0) {
1010 throw InternalErr(__FILE__, __LINE__,
"unable to close attibute id");
1014 d4g->attributes()->add_attribute_nocopy(d4_attr);
1016 d4b->attributes()->add_attribute_nocopy(d4_attr);
1017 else if ( 2 == flag)
1018 d4s->attributes()->add_attribute_nocopy(d4_attr);
1022 string msg =
"The add_dap4_attr flag has to be either 0,1 or 2.";
1023 msg+=
"The current flag is "+sflag.str();
1025 throw InternalErr(__FILE__, __LINE__, msg);
1047void map_h5_dset_hardlink_to_d4(hid_t h5_dsetid,
const string & full_path, BaseType* d4b,Structure * d4s,
int flag) {
1050 string oid = get_hardlink_dmr(h5_dsetid, full_path);
1053 if(
false == oid.empty()) {
1055 D4Attribute *d4_hlinfo =
new D4Attribute(
"HDF5_HARDLINK",attr_str_c);
1059 d4b->attributes()->add_attribute_nocopy(d4_hlinfo);
1060 else if ( 2 == flag)
1061 d4s->attributes()->add_attribute_nocopy(d4_hlinfo);
1080void get_softlink(D4Group* par_grp, hid_t h5obj_id,
const string & oname,
int index,
size_t val_size)
1082 BESDEBUG(
"h5",
"dap4 >get_softlink():" << oname << endl);
1085 oss << string(
"HDF5_SOFTLINK");
1088 string temp_varname = oss.str();
1091 BESDEBUG(
"h5",
"dap4->get_softlink():" << temp_varname << endl);
1092 auto d4_slinfo =
new D4Attribute;
1093 d4_slinfo->set_name(temp_varname);
1096 d4_slinfo->set_type(attr_container_c);
1098 string softlink_name =
"linkname";
1100 auto softlink_src =
new D4Attribute(softlink_name,attr_str_c);
1101 softlink_src->add_value(oname);
1103 d4_slinfo->attributes()->add_attribute_nocopy(softlink_src);
1104 string softlink_value_name =
"LINKTARGET";
1107 D4Attribute *softlink_tgt =
nullptr;
1111 buf.resize(val_size + 1);
1114 if (H5Lget_val(h5obj_id, oname.c_str(), (
void*) buf.data(), val_size + 1, H5P_DEFAULT) < 0) {
1115 throw InternalErr(__FILE__, __LINE__,
"unable to get link value");
1117 softlink_tgt =
new D4Attribute(softlink_value_name, attr_str_c);
1118 auto link_target_name = string(buf.begin(), buf.end());
1119 softlink_tgt->add_value(link_target_name);
1121 d4_slinfo->attributes()->add_attribute_nocopy(softlink_tgt);
1124 delete softlink_tgt;
1128 par_grp->attributes()->add_attribute_nocopy(d4_slinfo);
1144string get_hardlink_dmr( hid_t h5obj_id,
const string & oname) {
1146 BESDEBUG(
"h5",
"dap4->get_hardlink_dmr():" << oname << endl);
1149 H5O_info_t obj_info;
1150 if (H5OGET_INFO(h5obj_id, &obj_info) <0) {
1151 throw InternalErr(__FILE__, __LINE__,
"H5OGET_INFO() failed.");
1158 if (obj_info.rc >1) {
1162#if (H5_VERS_MAJOR == 1 && ((H5_VERS_MINOR == 12) || (H5_VERS_MINOR == 13)))
1163 char *obj_tok_str =
nullptr;
1164 if(H5Otoken_to_str(h5obj_id, &(obj_info.token), &obj_tok_str) <0) {
1165 throw InternalErr(__FILE__, __LINE__,
"H5Otoken_to_str failed.");
1167 objno.assign(obj_tok_str,obj_tok_str+strlen(obj_tok_str));
1168 H5free_memory(obj_tok_str);
1172 oss << hex << obj_info.addr;
1176 BESDEBUG(
"h5",
"dap4->get_hardlink_dmr() objno=" << objno << endl);
A class for handling all types of array in HDF5 for the default option.
This class provides a way to map HDF5 byte to DAP Byte for the default option.
This file includes several helper functions for translating HDF5 to CF-compliant.
A class for mapping HDF5 32-bit float to DAP for the default option.
A class for mapping HDF5 64-bit float to DAP for the default option.
A class for HDF5 signed 16 bit integer type.
This class provides a way to map HDF5 32 bit integer to DAP Int32 for the default option.
This class that translates HDF5 string into DAP string for the default option.
This class converts HDF5 compound type into DAP structure for the default option.
This class provides a way to map unsigned HDF5 16 bit integer to DAP UInt16 for the default option.
This class provides a way to map unsigned HDF5 32 bit integer to DAP UInt32.
This class generates DAP URL type for the default option.
bool add(const std::string &id, const std::string &name)
std::string get_name(const std::string &id)
void depth_first(hid_t pid, const char *gname, DAS &das)
void read_objects(DAS &das, const string &varname, hid_t oid, int num_attr)
void read_objects_base_type(DDS &dds_table, const string &varname, const string &filename)
void read_objects_structure(DDS &dds_table, const string &varname, const string &filename)
void map_h5_attrs_to_dap4(hid_t oid, D4Group *d4g, BaseType *d4b, Structure *d4s, int flag)
A function that map HDF5 attributes to DAP4.
HDF5PathFinder obj_paths
A variable for remembering visited paths to break cyclic HDF5 groups.
bool breadth_first(const hid_t file_id, hid_t pid, const char *gname, D4Group *par_grp, const char *fname, bool use_dimscale, vector< link_info_t > &hdf5_hls)
void get_softlink(D4Group *par_grp, hid_t h5obj_id, const string &oname, int index, size_t val_size)
Data structure and retrieval processing header for the default option.
string print_attr(hid_t type, int loc, void *sm_buf)
string get_dap_type(hid_t type, bool is_dap4)
void get_dataset(hid_t pid, const string &dname, DS_t *dt_inst_ptr)
hid_t get_attr_info(hid_t dset, int index, bool is_dap4, DSattr_t *attr_inst_ptr, bool *ignore_attr_ptr)
The main header of the HDF5 OPeNDAP handler.
const int DODS_NAMELEN
Maximum length of variable or attribute name(default option only).
A structure for DDS generation.
hsize_t nelmts
Number of elements.
hsize_t need
Space needed.
hid_t type
HDF5 data set id.
int size[DODS_MAX_RANK]
Size of each dimension.
int ndims
HDF5 data space id.
A structure for DAS generation.
char name[DODS_NAMELEN]
Name of HDF5 group or dataset.
int ndims
Number of dimensions.
hsize_t nelmts
Number of elements.
hsize_t need
Memory space needed to hold nelmts type.