OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
FONcArray.h
Go to the documentation of this file.
1 // FONcArray.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 FONcArray_h_
33 #define FONcArray_h_ 1
34 
35 #include <Array.h>
36 
37 using namespace libdap ;
38 
39 #include "FONcBaseType.h"
40 #include "FONcDim.h"
41 
42 class FONcMap;
43 
50 class FONcArray : public FONcBaseType
51 {
52 private:
53  // The array being converted
54  Array * _a ;
55  // The type of data stored in the array
56  nc_type _array_type ;
57  // The number of dimensions to be stored in netcdf (if string, 2)
58  int _ndims ;
59  // The actual number of dimensions of this array (if string, 1)
60  int _actual_ndims ;
61  // The number of elements that will be stored in netcdf
62  int _nelements ;
63  // The FONcDim dimensions to be used for this variable
64  vector<FONcDim *> _dims ;
65  // The netcdf dimension ids for this array
66  int * _dim_ids ;
67  // The netcdf dimension sizes to be written
68  size_t * _dim_sizes ; // changed int to size_t. jhrg 12.27.2011
69  // If string data, we need to do some comparison, so instead of
70  // reading it more than once, read it once and save here
71  string * _str_data ;
72  // If the array is already a map in a grid, then we don't want to
73  // define it or write it.
74  bool _dont_use_it ;
75  // The netcdf chunk sizes for each dimension of this array.
76  size_t * _chunksizes;
77  // This is vector holds instances pf FONcMap* that wrap existing Array
78  // objects that are pushed onto the global FONcGrid::Maps vector. Those
79  // are never freed; I think the general pattern is to use the reference
80  // counting pointers with FONcGrid::Maps. jhrg 8/28/13
81  vector<FONcMap*> _grid_maps;
82 
83  FONcDim * find_dim( vector<string> &embed, const string &name, int size, bool ignore_size = false ) ;
84 public:
85  FONcArray( BaseType *b ) ;
86  virtual ~FONcArray() ;
87 
88  virtual void convert( vector<string> embed ) ;
89  virtual void define( int ncid ) ;
90  virtual void write( int ncid ) ;
91 
92  virtual string name() ;
93  virtual Array * array() { return _a ; }
94 
95  virtual void dump( ostream &strm ) const ;
96 
97  static vector<FONcDim *> Dimensions ;
98 } ;
99 
100 #endif // FONcArray_h_
101 
A map of a DAP Grid with file out netcdf information included.
Definition: FONcMap.h:46
A DAP Array with file out netcdf information included.
Definition: FONcArray.h:50
virtual Array * array()
Definition: FONcArray.h:93
static vector< FONcDim * > Dimensions
Definition: FONcArray.h:97
static class NCMLUtil overview
A class that represents the dimension of an array.
Definition: FONcDim.h:44
A DAP BaseType with file out netcdf information included.
Definition: FONcBaseType.h:48