bes  Updated for version 3.20.10
HDF5GMCFMissLLArray.h
Go to the documentation of this file.
1 // This file is part of the hdf5_handler implementing for the CF-compliant
2 // Copyright (c) 2011-2016 The HDF Group, Inc. and OPeNDAP, Inc.
3 //
4 // This is free software; you can redistribute it and/or modify it under the
5 // terms of the GNU Lesser General Public License as published by the Free
6 // Software Foundation; either version 2.1 of the License, or (at your
7 // option) any later version.
8 //
9 // This software is distributed in the hope that it will be useful, but
10 // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
12 // License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 //
18 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
19 // You can contact The HDF Group, Inc. at 1800 South Oak Street,
20 // Suite 203, Champaign, IL 61820
21 
31 
32 #ifndef _HDF5GMCFMissLLARRAY_H
33 #define _HDF5GMCFMissLLARRAY_H
34 
35 // STL includes
36 #include <string>
37 #include <vector>
38 
39 // DODS includes
40 #include "HDF5CF.h"
41 //#include <libdap/Array.h>
42 #include "HDF5BaseArray.h"
43 
44 
46  public:
47  HDF5GMCFMissLLArray(int h5_rank, const string & h5_filename, const hid_t h5_fileid, H5DataType h5_dtype, const string &varfullpath, H5GCFProduct h5_product_type, CVType h5_cvartype, const string & n="", libdap::BaseType * v = 0):
48  HDF5BaseArray(n,v),
49  rank(h5_rank),
50  filename(h5_filename),
51  fileid(h5_fileid),
52  dtype(h5_dtype),
53  varname(varfullpath),
54  product_type(h5_product_type),
55  cvartype(h5_cvartype)
56  {
57  }
58 
59  virtual ~ HDF5GMCFMissLLArray() {
60  }
61  virtual libdap::BaseType *ptr_duplicate();
62  virtual bool read();
63 
64 
65  private:
66  int rank;
67  string filename;
68  hid_t fileid;
69  H5DataType dtype;
70  string varname;
71  H5GCFProduct product_type;
72  CVType cvartype;
73 
74  //template<class T>
75  template<typename T>
76  void obtain_ll_attr_value(hid_t file_id, hid_t s_root_id,const std::string& s_attr_name, T& attr_value,std::vector<char> & str_attr_value );
77  virtual void read_data_NOT_from_mem_cache(bool add_cache,void*buf);
78  void obtain_aqu_obpg_l3_ll(int* offset,int* step,int nelms,bool add_cache, void*buf);
79 
80  void obtain_gpm_l3_ll(int* offset,int* step,int nelms,bool add_cache, void*buf);
81  void obtain_gpm_l3_new_grid_info(hid_t fileid,vector<char>& grid_info_value1, vector<char>& grid_info_value2);
82  void obtain_lat_lon_info(const vector<char>& grid_info_value1,
83  const vector<char>& grid_info_value2,int& latsize,int& lonsize,
84  float& lat_start,float& lon_start,float& lat_res,float& lon_res);
85  //void send_gpm_l3_ll_to_dap(const vector<char>& grid_info_value,int* offset,int* step,int nelms,bool add_cache, void*buf);
86  void send_gpm_l3_ll_to_dap(const int latsize,const int lonsize,float lat_start,float lon_start,float lat_res, float lon_res,
87  const int* offset, const int* step, const int nelms, const bool add_cache, void*buf);
88 };
89  static int
90  visit_obj_cb(hid_t group_id, const char *name, const H5O_info_t *oinfo,
91  void *_op_data);
92  static herr_t
93  attr_info(hid_t loc_id, const char *name, const H5A_info_t *ainfo, void *_op_data);
94 
95 
96 #endif // _HDF5GMCFMissLLARRAY_H
97 
A helper class that aims to reduce code redundence for different special CF derived array class For e...
This class specifies the core engineering of mapping HDF5 to DAP by following CF.