OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
HDF5Array.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 // Author: Hyo-Kyung Lee <hyoklee@hdfgroup.org> and Muqun Yang
5 // <myang6@hdfgroup.org>
6 
7 // Copyright (c) 2009-2013 The HDF Group, Inc. and OPeNDAP, Inc.
8 //
9 // This is free software; you can redistribute it and/or modify it under the
10 // terms of the GNU Lesser General Public License as published by the Free
11 // Software Foundation; either version 2.1 of the License, or (at your
12 // option) any later version.
13 //
14 // This software is distributed in the hope that it will be useful, but
15 // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
17 // License for more details.
18 //
19 // You should have received a copy of the GNU Lesser General Public
20 // License along with this library; if not, write to the Free Software
21 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 //
23 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
24 // You can contact The HDF Group, Inc. at 1800 South Oak Street,
25 // Suite 203, Champaign, IL 61820
26 
27 #ifndef _hdf5array_h
28 #define _hdf5array_h 1
29 
30 #include <H5Ipublic.h>
31 #include <H5Rpublic.h>
32 
33 #include "Array.h"
34 #include "h5get.h"
35 
36 using namespace libdap;
37 
49 class HDF5Array:public Array {
50  private:
51  int d_num_dim;
52  int d_num_elm;
53  hid_t d_dset_id;
54  hid_t d_ty_id;
55  size_t d_memneed;
56 
57  // Parse constraint expression and make HDF5 coordinate point location.
58  // return number of elements to read.
59  int format_constraint(int *cor, int *step, int *edg);
60 
61  // Handling constraint expression on array of structure requires the
62  // following linearizion function since the HDF5 array of structure is
63  // 1-D (linear) while constraint expression can be multi-dimensional.
64  // Based on the \param start, \param stride, and \param count,
65  // this function will pick the corresponding array indexes from HDF5 array
66  // and the picked indexes will be stored under \param picks.
67  int linearize_multi_dimensions(int *start, int *stride, int *count,
68  int *picks);
69  hid_t mkstr(int size, H5T_str_t pad);
70 
71  bool m_array_of_structure(); // Used by read()
72  bool m_array_in_structure();
73  void m_insert_simple_array(hid_t s1_tid, hsize_t *size2);
74  bool m_array_of_reference();
75  void m_intern_plain_array_data(char *convbuf);
76 
77  public:
79  H5T_class_t d_type;
80 
82  HDF5Array(const string & n, const string &d, BaseType * v);
83  virtual ~ HDF5Array();
84 
90  virtual BaseType *ptr_duplicate();
91 
93  virtual bool read();
94 
96  friend string return_type(hid_t datatype);
97 
99  hid_t get_did();
101  hid_t get_tid();
102 
104  bool read_vlen_string(hid_t d_dset_id, hid_t d_ty_id, int nelms,
105  int *offset, int *step, int *count);
106 
108  void set_did(hid_t dset);
109 
111  void set_tid(hid_t type);
112 
114  void set_memneed(size_t need);
115 
117  void set_numdim(int ndims);
118 
120  void set_numelm(int nelms);
121 };
122 
123 #endif
H5T_class_t d_type
HDF5 data type class.
Definition: HDF5Array.h:79
static class NCMLUtil overview
Helper functions to generate DDS/DAS/DODS for the default option.