bes  Updated for version 3.20.6
NCArray.h
1 
2 // -*- mode: c++; c-basic-offset:4 -*-
3 
4 // This file is part of nc_handler, a data handler for the OPeNDAP data
5 // server.
6 
7 // Copyright (c) 2002,2003 OPeNDAP, Inc.
8 // Author: James Gallagher <jgallagher@opendap.org>
9 //
10 // This is free software; you can redistribute it and/or modify it under the
11 // terms of the GNU Lesser General Public License as published by the Free
12 // Software Foundation; either version 2.1 of the License, or (at your
13 // option) any later version.
14 //
15 // This software is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18 // License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the Free Software
22 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 //
24 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
25 
26 // (c) COPYRIGHT URI/MIT 1994-1996
27 // Please read the full copyright statement in the file COPYRIGHT.
28 //
29 // Authors:
30 // reza Reza Nekovei (reza@intcomm.net)
31 
32 // netCDF sub-class implementation for NCByte,...NCGrid.
33 // The files are patterned after the subcalssing examples
34 // Test<type>.c,h files.
35 //
36 // ReZa 1/12/95
37 
38 #ifndef _ncarray_h
39 #define _ncarray_h 1
40 
41 #include <sys/types.h>
42 
43 #include <sstream>
44 
45 #include <Array.h>
46 
47 #include <NCStructure.h>
48 
49 using namespace libdap ;
50 
51 class NCArray: public Array {
52 private:
53  long format_constraint(size_t *cor, ptrdiff_t *step, size_t *edg, bool *has_stride);
54 
55  void do_cardinal_array_read(int ncid, int varid, nc_type datatype,
56  vector<char> &values, bool has_values, int values_offset,
57  int nels, size_t cor[], size_t edg[], ptrdiff_t step[], bool has_stride);
58 
59  void do_array_read(int ncid, int varid, nc_type datatype,
60  vector<char> &values, bool has_values, int values_offset,
61  int nels, size_t cor[], size_t edg[], ptrdiff_t step[], bool has_stride);
62 
63  friend class NCStructure;
64 
65 public:
66  NCArray(const string &n, const string &d, BaseType *v);
67  NCArray(const NCArray &nc_array);
68  NCArray &operator=(const NCArray &rhs);
69  virtual ~NCArray();
70 
71  virtual BaseType *ptr_duplicate();
72 
73  virtual bool read();
74 };
75 
76 /*
77  * $Log: NCArray.h,v $
78  * Revision 1.16 2005/04/19 23:16:18 jimg
79  * Removed client side parts; the client library is now in libnc-dap.
80  *
81  * Revision 1.15 2005/04/11 18:38:20 jimg
82  * Fixed a problem with NCSequence where nested sequences were not flagged
83  * but instead were translated. The extract_values software cannot process a
84  * nested sequence yet. Now the code inserts an attribute that notes that a
85  * nested sequence has been elided.
86  *
87  * Revision 1.14 2005/04/08 17:08:47 jimg
88  * Removed old 'virtual ctor' functions which have now been replaced by the
89  * factory class code in libdap++.
90  *
91  * Revision 1.13 2005/03/31 00:04:51 jimg
92  * Modified to use the factory class in libdap++ 3.5.
93  *
94  * Revision 1.12 2005/02/26 00:43:20 jimg
95  * Check point: This version of the CL can now translate strings from the
96  * server into char arrays. This is controlled by two things: First a
97  * compile-time directive STRING_AS_ARRAY can be used to remove/include
98  * this feature. When included in the code, only Strings associated with
99  * variables created by the translation process will be turned into char
100  * arrays. Other String variables are assumed to be single character strings
101  * (although there may be a bug with the way these are handled, see
102  * NCAccess::extract_values()).
103  *
104  * Revision 1.11 2005/02/17 23:44:13 jimg
105  * Modifications for processing of command line projections combined
106  * with the limit stuff and projection info passed in from the API. I also
107  * consolodated some of the code by moving d_source from various
108  * classes to NCAccess. This may it so that DODvario() could be simplified
109  * as could build_constraint() and store_projection() in NCArray.
110  *
111  * Revision 1.10 2005/01/26 23:25:51 jimg
112  * Implemented a fix for Sequence access by row number when talking to a
113  * 3.4 or earlier server (which contains a bug in is_end_of_rows()).
114  *
115  * Revision 1.9 2004/11/30 22:11:35 jimg
116  * I replaced the flatten_*() functions with a flatten() method in
117  * NCAccess. The default version of this method is in NCAccess and works
118  * for the atomic types; constructors must provide a specialization.
119  * Then I removed the code that copied the variables from vectors to
120  * lists. The translation code in NCConnect was modified to use the
121  * new method.
122  *
123  * Revision 1.8 2004/10/28 16:38:19 jimg
124  * Added support for error handling to ClientParams. Added use of
125  * ClientParams to NCConnect, although that's not complete yet. NCConnect
126  * now has an instance of ClientParams. The instance is first built and
127  * then passed into NCConnect's ctor which stores a const reference to the CP
128  * object.
129  *
130  * Revision 1.7 2004/10/22 21:51:34 jimg
131  * More massive changes: Translation of Sequences now works so long as the
132  * Sequence contains only atomic types.
133  *
134  * Revision 1.6 2004/09/08 22:08:21 jimg
135  * More Massive changes: Code moved from the files that clone the netCDF
136  * function calls into NCConnect, NCAccess or nc_util.cc. Much of the
137  * translation functions are now methods. The netCDF type classes now
138  * inherit from NCAccess in addition to the DAP type classes.
139  *
140  * Revision 1.5 2003/12/08 18:06:37 edavis
141  * Merge release-3-4 into trunk
142  *
143  * Revision 1.4 2003/09/25 23:09:36 jimg
144  * Meerged from 3.4.1.
145  *
146  * Revision 1.3.4.2 2003/06/24 11:36:32 rmorris
147  * Removed #pragma interface directives for the OS X.
148  *
149  * Revision 1.3.4.1 2003/06/07 22:02:32 reza
150  * Fixed char vs. byte and long vs. nclong error checks.
151  *
152  * Revision 1.3 2002/05/03 00:01:52 jimg
153  * Merged with release-3-2-7.
154  *
155  * Revision 1.2.4.1 2001/12/26 03:32:24 rmorris
156  * Removed redundant default args. VC++ only allows them to be specified
157  * a single time.
158  *
159  * Revision 1.2 2000/10/06 01:22:02 jimg
160  * Moved the CVS Log entries to the ends of files.
161  * Modified the read() methods to match the new definition in the dap library.
162  * Added exception handlers in various places to catch exceptions thrown
163  * by the dap library.
164  *
165  * Revision 1.1 1999/07/28 00:22:42 jimg
166  * Added
167  *
168  * Revision 1.5 1999/05/07 23:45:31 jimg
169  * String --> string fixes
170  *
171  * Revision 1.4 1996/09/17 17:06:17 jimg
172  * Merge the release-2-0 tagged files (which were off on a branch) back into
173  * the trunk revision.
174  *
175  * Revision 1.3.4.2 1996/07/10 21:43:55 jimg
176  * Changes for version 2.06. These fixed lingering problems from the migration
177  * from version 1.x to version 2.x.
178  * Removed some (but not all) warning generated with gcc's -Wall option.
179  *
180  * Revision 1.3.4.1 1996/06/25 22:04:19 jimg
181  * Version 2.0 from Reza.
182  *
183  * Revision 1.3 1995/03/21 20:58:16 jimg
184  * Resolved conflicts between my (jhrg) files and those checked in by Reza.
185  *
186  * Revision 1.2 1995/03/16 16:56:26 reza
187  * Updated for the new DAP. All the read_val mfunc. and their memory management
188  * are now moved to their parent class.
189  * Data transfers are now in binary while DAS and DDS are still sent in ASCII.
190  *
191  * Revision 1.1 1995/02/10 04:57:15 reza
192  * Added read and read_val functions.
193  */
194 
195 #endif
196 
197 
libdap
Definition: BESDapFunctionResponseCache.h:35
NCStructure
Definition: NCStructure.h:51
NCArray
Definition: NCArray.h:51