bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
h5get.h
Go to the documentation of this file.
1// This file is part of hdf5_handler a HDF5 file handler for the OPeNDAP
2// data server.
3
4// Copyright (c) 2007-2023 The HDF Group, Inc. and OPeNDAP, Inc.
5//
6// This is free software; you can redistribute it and/or modify it under the
7// terms of the GNU Lesser General Public License as published by the Free
8// Software Foundation; either version 2.1 of the License, or (at your
9// option) any later version.
10//
11// This software is distributed in the hope that it will be useful, but
12// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14// License for more details.
15//
16// You should have received a copy of the GNU Lesser General Public
17// License along with this library; if not, write to the Free Software
18// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19//
20// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
21// You can contact The HDF Group, Inc. at 410 E University Avenue, Suite 200,
22// Champaign, IL 61820
28
29
30#ifndef _H5GET_H
31#define _H5GET_H
32#include "hdf5_handler.h"
33#include "h5common.h"
34#include "h5apicompatible.h"
35
37 unsigned char* ucp;
38 char *tcp;
39 short *tsp;
40 unsigned short *tusp;
41 int *tip;
42 unsigned int*tuip;
43 long *tlp;
44 unsigned long*tulp;
45 float *tfp;
46 double *tdp;
47};
48
49bool check_h5str(hid_t);
50
51void close_fileid(hid_t fid);
52
53hid_t get_attr_info(hid_t dset, int index, bool, DSattr_t * attr_inst, bool*);
54bool check_ignored_attrs(hid_t attrid, hid_t ty_id, const vector <char>& attr_name, bool is_dap4);
55
56std::string get_dap_type(hid_t type, bool);
57std::string get_dap_integer_type(hid_t dtype, bool);
58
59void get_dataset_dmr(hid_t file_id, hid_t pid, const std::string &dname, DS_t * dt_inst_ptr, bool has_dimscale,
60 bool is_eos5, bool &is_pure_dims, std::vector<link_info_t> &, std::vector<std::string> &);
61void get_dataset(hid_t pid, const std::string &dname, DS_t * dt_inst_ptr);
62
63hid_t get_fileid(const char *filename);
64
65std::string print_attr(hid_t type, int loc, void *sm_buf);
66void print_integer_type_attr(hid_t atype, int loc, void*sm_buf, union attr_data_ptr_t gp, std::vector<char> &rep ) ;
67void print_float_type_attr(hid_t atype, int loc, void*sm_buf, union attr_data_ptr_t gp, vector<char> &rep );
68
69D4AttributeType daptype_strrep_to_dap4_attrtype(const std::string & s);
70
71libdap::BaseType *Get_bt_enhanced(libdap::D4Group *d4_grp, hid_t pid, const std::string &vname, const std::string &var_path,
72 const std::string &dataset, hid_t datatype);
73
74
75libdap::BaseType *Get_bt(const std::string &vname, const std::string &var_path,
76 const std::string &dataset, hid_t datatype, bool is_dap4);
77
78libdap::BaseType *Get_integer_bt(const std::string &vname, const std::string &vpath,
79 const std::string &dataset, hid_t datatype, bool is_dap4);
80libdap::BaseType *Get_byte_bt(const std::string &vname, const std::string &vpath, const std::string &dataset,
81 H5T_sign_t sign, bool is_dap4);
82libdap::BaseType *Get_float_bt(const std::string &vname, const std::string &vpath,
83 const std::string &dataset, hid_t datatype);
84
85libdap::Structure *Get_structure(const std::string &varname, const std::string &var_path,
86 const std::string &dataset, hid_t datatype,bool is_dap4);
87void Get_structure_array_type(libdap::Structure *structure_ptr, hid_t memb_type, const std::string &memb_name,
88 const std::string &dataset, bool is_dap4 );
89
90void handle_vlen_int_float(libdap::D4Group *d4_grp, hid_t pid, const std::string &vname, const std::string &var_path,
91 const std::string &filename, hid_t dset_id);
92
93bool check_dimscale(hid_t fid);
94bool has_dimscale_attr(hid_t dataset);
95void obtain_dimnames(hid_t file_id, hid_t dset, int ndim, DS_t*dt_inst_ptr, std::vector<link_info_t>&, bool is_eos5);
96void obtain_dimnames_internal(hid_t file_id,hid_t dset,int ndims, DS_t *dt_inst_ptr,std::vector<link_info_t> & hdf5_hls,
97 bool is_eos5, const string &dimlist_name);
98std::string obtain_dimname_deref(hid_t ref_dset, const DS_t *dt_inst_ptr);
99void obtain_dimname_hardlinks(hid_t file_id, hid_t ref_dset, vector<link_info_t>& hdf5_hls, std::string & trim_objname);
100bool handle_dimscale_dmr(hid_t file_id, hid_t dset, hid_t dspace, bool is_eos5,
101 DS_t * dt_inst_ptr,std::vector<link_info_t> &hdf5_hls,std::vector<std::string> &handled_cv_names);
102
103void write_vlen_str_attrs(hid_t attr_id, hid_t ty_id, const DSattr_t *, libdap::D4Attribute *d4_attr,
104 libdap::AttrTable* d2_attr, bool is_dap4);
105
106libdap::D4EnumDef* map_hdf5_enum_to_dap4(libdap::D4Group *d4_grp, hid_t pid, hid_t datatype);
107void obtain_enum_def_name_value(hid_t base_datatype, hid_t datatype, vector<string>& labels, vector<int64_t> &label_values);
108
109bool check_if_utf8_str(hid_t ty_id);
110bool check_str_attr_value(hid_t attr_id, hid_t atype_id, const string & value_to_compare, bool is_substr);
111hsize_t obtain_number_elements(hid_t space_id);
112std::string obtain_vlstr_values(std::vector<char> & temp_buf, hid_t atype_id, size_t ty_size,
113 hsize_t nelmts, hid_t aspace_id);
114
115std::string obtain_assigned_obj_name(const vector<string>& obj_names, const string &obj_name_mark);
116std::string obtain_shortest_ancestor_path(const std::vector<std::string> &);
117
118std::string handle_string_special_characters(std::string &s);
119std::string handle_string_special_characters_in_path(const string &instr);
120
121std::string invalid_type_error_msg(const std::string &s);
122#endif //_H5GET_H
STL class.
The main header of the HDF5 OPeNDAP handler.
struct DS DS_t
A structure for DDS generation.
struct DSattr DSattr_t
A structure for DAS generation.