bes  Updated for version 3.20.10
FONcTransform.h
1 // FONcTransform.h
2 
3 // This file is part of BES Netcdf File Out Module
4 
5 // Copyright (c) 2004,2005 University Corporation for Atmospheric Research
6 // Author: Patrick West <pwest@ucar.edu> and Jose Garcia <jgarcia@ucar.edu>
7 //
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Lesser General Public
10 // License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 //
22 // You can contact University Corporation for Atmospheric Research at
23 // 3080 Center Green Drive, Boulder, CO 80301
24 
25 // (c) COPYRIGHT University Corporation for Atmospheric Research 2004-2005
26 // Please read the full copyright statement in the file COPYRIGHT_UCAR.
27 //
28 // Authors:
29 // pwest Patrick West <pwest@ucar.edu>
30 // jgarcia Jose Garcia <jgarcia@ucar.edu>
31 
32 #ifndef FONcTransfrom_h_
33 #define FONcTransfrom_h_ 1
34 
35 #include <netcdf.h>
36 
37 #include <string>
38 #include <vector>
39 #include <map>
40 #include <set>
41 
42 #include <libdap/DDS.h>
43 #include <libdap/DMR.h>
44 #include <libdap/Array.h>
45 
46 using namespace::libdap ;
47 
48 #include <BESObj.h>
49 #include <BESDataHandlerInterface.h>
50 
51 class FONcBaseType ;
52 class BESResponseObject;
53 
61 class FONcTransform: public BESObj {
62 private:
63  int _ncid;
64  DDS *_dds;
65  DMR *_dmr;
66  BESResponseObject *d_obj;
68  string _localfile;
69  string _returnAs;
70  vector<FONcBaseType *> _fonc_vars;
71  vector<FONcBaseType *> _total_fonc_vars_in_grp;
72  set<string> _included_grp_names;
73  map<string,unsigned long> GFQN_dimname_to_dimsize;
74  map<string,unsigned long> VFQN_dimname_to_dimsize;
75 
76 
77 public:
88  FONcTransform(DDS *dds, BESDataHandlerInterface &dhi, const string &localfile, const string &netcdfVersion = "netcdf");
89  FONcTransform(DMR *dmr, BESDataHandlerInterface &dhi, const string &localfile, const string &netcdfVersion = "netcdf");
90  FONcTransform(BESResponseObject *obj, BESDataHandlerInterface *dhi, const string &localfile, const string &ncVersion = "netcdf");
91  virtual ~FONcTransform();
92  virtual void transform_dap2(ostream &strm);
93  virtual void transform_dap4();
94 
95 
96  virtual void dump(ostream &strm) const;
97 private:
98  virtual void transform_dap4_no_group();
99  virtual void transform_dap4_group(D4Group*,bool is_root, int par_grp_id,std::map<std::string,int>&,std::vector<int>&);
100  virtual void transform_dap4_group_internal(D4Group*,bool is_root, int par_grp_id,std::map<std::string,int>&,std::vector<int>&);
101  virtual void check_and_obtain_dimensions(D4Group*grp,bool);
102  virtual void check_and_obtain_dimensions_internal(D4Group*grp);
103  virtual bool check_group_support();
104  virtual void gen_included_grp_list(D4Group*grp);
105 
106  virtual bool is_streamable();
107  virtual bool is_dds_streamable();
108  virtual bool is_dmr_streamable(D4Group *group);
109 
110 };
111 
112 #endif // FONcTransfrom_h_
113 
Structure storing information used by the BES to handle the request.
top level BES object to house generic methods
Definition: BESObj.h:50
Abstract base class representing a specific set of information in response to a request to the BES.
A DAP BaseType with file out netcdf information included.
Definition: FONcBaseType.h:64
Transformation object that converts an OPeNDAP DataDDS to a netcdf file.
Definition: FONcTransform.h:61
FONcTransform(DDS *dds, BESDataHandlerInterface &dhi, const string &localfile, const string &netcdfVersion="netcdf")
virtual void dump(ostream &strm) const
dumps information about this transformation object for debugging purposes
virtual void transform_dap2(ostream &strm)
Transforms each of the variables of the DataDDS to the NetCDF file.
virtual void transform_dap4()
Transforms each of the variables of the DMR to the NetCDF file.
virtual ~FONcTransform()
Destructor.