bes  Updated for version 3.20.6
FONcBaseType.h
1 // FONcBaseType.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 FONcBaseType_h_
33 #define FONcBaseType_h_ 1
34 
35 #include <netcdf.h>
36 #include <vector>
37 #include <string>
38 
39 
40 #include <BESObj.h>
41 //#include <BaseType.h>
42 
43 #define RETURNAS_NETCDF "netcdf"
44 #define RETURNAS_NETCDF4 "netcdf-4"
45 
46 namespace libdap {
47 class BaseType;
48 }
49 
50 //using namespace libdap;
51 
58 class FONcBaseType: public BESObj {
59 protected:
60  int _varid;
61  std::string _varname;
62  std::string _orig_varname;
63  std::vector<std::string> _embed;
64  bool _defined;
65  std::string _ncVersion;
66 
67  FONcBaseType() : _varid(0), _defined(false) { }
68 
69 public:
70  virtual ~FONcBaseType() { }
71 
72  virtual void convert(std::vector<std::string> embed);
73  virtual void define(int ncid);
74  virtual void write(int /*ncid*/) { }
75 
76  virtual std::string name() = 0;
77  virtual nc_type type();
78  virtual void clear_embedded();
79  virtual int varid() const { return _varid; }
80 
81  virtual void dump(std::ostream &strm) const = 0;
82 
83  virtual void setVersion(std::string version);
84  virtual bool isNetCDF4();
85 
86 };
87 
88 #endif // FONcBaseType_h_
89 
FONcBaseType::define
virtual void define(int ncid)
Define the variable in the netcdf file.
Definition: FONcBaseType.cc:53
FONcBaseType::dump
virtual void dump(std::ostream &strm) const =0
dump the contents of this object to the specified ostream
FONcBaseType::type
virtual nc_type type()
Returns the type of data of this variable.
Definition: FONcBaseType.cc:74
FONcBaseType::clear_embedded
virtual void clear_embedded()
Clears the list of embedded variable names.
Definition: FONcBaseType.cc:81
libdap
Definition: BESDapFunctionResponseCache.h:35
BESObj
top level BES object to house generic methods
Definition: BESObj.h:49
FONcBaseType
A DAP BaseType with file out netcdf information included.
Definition: FONcBaseType.h:58
FONcBaseType::isNetCDF4
virtual bool isNetCDF4()
Returns true if NetCDF4 features will be required.
Definition: FONcBaseType.cc:97
FONcBaseType::setVersion
virtual void setVersion(std::string version)
Identifies variable with use of NetCDF4 features.
Definition: FONcBaseType.cc:88