rasdaman complete source
netcdf.hh
Go to the documentation of this file.
1 /*
2  * This file is part of rasdaman community.
3  *
4  * Rasdaman community is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * Rasdaman community is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
16  *
17  * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
18 rasdaman GmbH.
19  *
20  * For more information please see <http://www.rasdaman.org>
21  * or contact Peter Baumann via <baumann@rasdaman.com>.
22 /
40 #ifndef _R_CONV_NETCDF_HH_
41 #define _R_CONV_NETCDF_HH_
42 
43 #include "conversion/convertor.hh"
44 
45 #ifdef HAVE_NETCDF
46 #include "netcdfcpp.h"
47 #endif
48 
49 #include <string>
50 
51 //@ManMemo: Module {\bf conversion}
52 
53 /*@Doc:
54  NETCDF convertor class.
55 
56  No compression method is supported yet
57 
58  */
60 {
61 public:
63  r_Conv_NETCDF(const char *src, const r_Minterval &interv, const r_Type *tp) throw (r_Error);
65  r_Conv_NETCDF(const char *src, const r_Minterval &interv, int tp) throw (r_Error);
67  ~r_Conv_NETCDF(void);
68 
70  virtual r_convDesc &convertTo(const char *options = NULL) throw (r_Error);
72  virtual r_convDesc &convertFrom(const char *options = NULL) throw (r_Error);
73 
75  virtual r_Convertor *clone(void) const;
76 
78  virtual const char *get_name(void) const;
79  virtual r_Data_Format get_data_format(void) const;
80 
81 
82 private:
83 
85  void initNETCDF(void);
87  template <class baseType, class castType> void print(baseType* val, int bufferZise);
89  const char *Conventions;
90  const char *Institution;
91  char *variable;
92 
93  // for supporting more than one variable
94  char **vars;
95  int varsSize;
96  void getVars(void);
97 };
98 
99 #endif
virtual r_Data_Format get_data_format(void) const
virtual r_Convertor * clone(void) const
cloning
Definition: error.hh:88
Definition: raslib/type.hh:56
virtual r_convDesc & convertTo(const char *options=NULL)
convert to NETCDF
Definition: convertor.hh:111
~r_Conv_NETCDF(void)
destructor
r_Data_Format
Definition: mddtypes.hh:133
virtual const char * get_name(void) const
identification
virtual r_convDesc & convertFrom(const char *options=NULL)
convert from NETCDF
r_Conv_NETCDF(const char *src, const r_Minterval &interv, const r_Type *tp)
constructor using an r_Type object. Exception if the type isn't atomic.
Definition: convertor.hh:240
Definition: netcdf.hh:59
Definition: convertor.hh:56
Definition: minterval.hh:249