NetCDF-C++ 4.3.1
ncException.h
1#include <exception>
2#include <string>
3#include <iostream>
4
5#ifndef NcExceptionClasses
6#define NcExceptionClasses
7
8namespace netCDF
9{
10
12
15 namespace exceptions
16 {
17
24 class NcException : public std::exception {
25 public:
26 //NcException(const string& complaint,const char* fileName,int lineNumber);
27 NcException(const char* complaint,const char* fileName,int lineNumber);
28 NcException(int errorCode, const char* complaint,const char* fileName,int lineNumber);
29 NcException(const NcException& e) throw();
30 NcException& operator=(const NcException& e) throw();
31 virtual ~NcException() throw();
32 const char* what() const throw();
33 int errorCode() const throw();
34 private:
35 std::string* what_msg;
36 int ec;
37 };
38
39
41 class NcBadId : public NcException
42 {
43 public:
44 NcBadId(const char* complaint,const char* file,int line);
45 };
46
48 class NcNFile : public NcException
49 {
50 public:
51 NcNFile(const char* complaint,const char* file,int line);
52 };
53
55 class NcExist : public NcException
56 {
57 public:
58 NcExist(const char* complaint,const char* file,int line);
59 };
60
63 {
64 public:
65 NcInvalidArg(const char* complaint,const char* file,int line);
66 };
67
70 {
71 public:
72 NcInvalidWrite(const char* complaint,const char* file,int line);
73 };
74
77 {
78 public:
79 NcNotInDefineMode(const char* complaint,const char* file,int line);
80 };
81
84 {
85 public:
86 NcInDefineMode(const char* complaint,const char* file,int line);
87 };
88
97 {
98 public:
99 NcInvalidCoords(const char* complaint,const char* file,int line);
100 };
101
103 class NcMaxDims : public NcException
104 {
105 public:
106 NcMaxDims(const char* complaint,const char* file,int line);
107 };
108
111 {
112 public:
113 NcNameInUse(const char* complaint,const char* file,int line);
114 };
115
117 class NcNotAtt : public NcException
118 {
119 public:
120 NcNotAtt(const char* complaint,const char* file,int line);
121 };
122
124 class NcMaxAtts : public NcException
125 {
126 public:
127 NcMaxAtts(const char* complaint,const char* file,int line);
128 };
129
131 class NcBadType : public NcException
132 {
133 public:
134 NcBadType(const char* complaint,const char* file,int line);
135 };
136
138 class NcBadDim : public NcException
139 {
140 public:
141 NcBadDim(const char* complaint,const char* file,int line);
142 };
143
145 class NcUnlimPos : public NcException
146 {
147 public:
148 NcUnlimPos(const char* complaint,const char* file,int line);
149 };
150
152 class NcMaxVars : public NcException
153 {
154 public:
155 NcMaxVars(const char* complaint,const char* file,int line);
156 };
157
159 class NcNotVar : public NcException
160 {
161 public:
162 NcNotVar(const char* complaint,const char* file,int line);
163 };
164
166 class NcGlobal : public NcException
167 {
168 public:
169 NcGlobal(const char* complaint,const char* file,int line);
170 };
171
173 class NcNotNCF : public NcException
174 {
175 public:
176 NcNotNCF(const char* complaint,const char* file,int line);
177 };
178
180 class NcSts : public NcException
181 {
182 public:
183 NcSts(const char* complaint,const char* file,int line);
184 };
185
187 class NcMaxName : public NcException
188 {
189 public:
190 NcMaxName(const char* complaint,const char* file,int line);
191 };
192
194 class NcUnlimit : public NcException
195 {
196 public:
197 NcUnlimit(const char* complaint,const char* file,int line);
198 };
199
202 {
203 public:
204 NcNoRecVars(const char* complaint,const char* file,int line);
205 };
206
208 class NcChar : public NcException
209 {
210 public:
211 NcChar(const char* complaint,const char* file,int line);
212 };
213
215 class NcEdge : public NcException
216 {
217 public:
218 NcEdge(const char* complaint,const char* file,int line);
219 };
220
222 class NcStride : public NcException
223 {
224 public:
225 NcStride(const char* complaint,const char* file,int line);
226 };
227
229 class NcBadName : public NcException
230 {
231 public:
232 NcBadName(const char* complaint,const char* file,int line);
233 };
234
236 class NcRange : public NcException
237 {
238 public:
239 NcRange(const char* complaint,const char* file,int line);
240 };
241
243 class NcNoMem : public NcException
244 {
245 public:
246 NcNoMem(const char* complaint,const char* file,int line);
247 };
248
250 class NcVarSize : public NcException
251 {
252 public:
253 NcVarSize(const char* complaint,const char* file,int line);
254 };
255
257 class NcDimSize : public NcException
258 {
259 public:
260 NcDimSize(const char* complaint,const char* file,int line);
261 };
262
264 class NcTrunc : public NcException
265 {
266 public:
267 NcTrunc(const char* complaint,const char* file,int line);
268 };
269
271 class NcHdfErr : public NcException
272 {
273 public:
274 NcHdfErr(const char* complaint,const char* file,int line);
275 };
276
278 class NcCantRead : public NcException
279 {
280 public:
281 NcCantRead(const char* complaint,const char* file,int line);
282 };
283
286 {
287 public:
288 NcCantWrite(const char* complaint,const char* file,int line);
289 };
290
293 {
294 public:
295 NcCantCreate(const char* complaint,const char* file,int line);
296 };
297
299 class NcFileMeta : public NcException
300 {
301 public:
302 NcFileMeta(const char* complaint,const char* file,int line);
303 };
304
306 class NcDimMeta : public NcException
307 {
308 public:
309 NcDimMeta(const char* complaint,const char* file,int line);
310 };
311
313 class NcAttMeta : public NcException
314 {
315 public:
316 NcAttMeta(const char* complaint,const char* file,int line);
317 };
318
320 class NcVarMeta : public NcException
321 {
322 public:
323 NcVarMeta(const char* complaint,const char* file,int line);
324 };
325
328 {
329 public:
330 NcNoCompound(const char* complaint,const char* file,int line);
331 };
332
335 {
336 public:
337 NcAttExists(const char* complaint,const char* file,int line);
338 };
339
341 class NcNotNc4 : public NcException
342 {
343 public:
344 NcNotNc4(const char* complaint,const char* file,int line);
345 };
346
349 {
350 public:
351 NcStrictNc3(const char* complaint,const char* file,int line);
352 };
353
356 {
357 public:
358 NcBadGroupId(const char* complaint,const char* file,int line);
359 };
360
363 {
364 public:
365 NcBadTypeId(const char* complaint,const char* file,int line);
366 };
367
370 {
371 public:
372 NcBadFieldId(const char* complaint,const char* file,int line);
373 };
374
377 {
378 public:
379 NcUnknownName(const char* complaint,const char* file,int line);
380 };
381
383 class NcEnoGrp : public NcException
384 {
385 public:
386 NcEnoGrp(const char* complaint,const char* file,int line);
387 };
388
394 class NcNullGrp : public NcException
395 {
396 public:
397 NcNullGrp(const char* complaint,const char* file,int line);
398 };
399
405 class NcNullType : public NcException
406 {
407 public:
408 NcNullType(const char* complaint,const char* file,int line);
409 };
410
416 class NcNullDim : public NcException
417 {
418 public:
419 NcNullDim(const char* complaint,const char* file,int line);
420 };
421
426 class NcElateDef : public NcException
427 {
428 public:
429 NcElateDef(const char* complaint,const char* file,int line);
430 };
431
432 }
433
434}
435
436#endif
437
Thrown if attribute exists.
Definition: ncException.h:335
Thrown if attribute meta.
Definition: ncException.h:314
Thrown if an invalid dimension id or name.
Definition: ncException.h:139
Thrown if bad field id.
Definition: ncException.h:370
Thrown if bad group id.
Definition: ncException.h:356
Thrown if the specified netCDF ID does not refer to an open netCDF dataset.
Definition: ncException.h:42
Thrown if attribute or variable name contains illegal characters.
Definition: ncException.h:230
Thrown if bad type id.
Definition: ncException.h:363
Thrown if not a valid netCDF data type.
Definition: ncException.h:132
Thrown if cannot create.
Definition: ncException.h:293
Thrown if cannot read.
Definition: ncException.h:279
Thrown if cannot write.
Definition: ncException.h:286
Thrown if attempt to convert between text and numbers.
Definition: ncException.h:209
Thrown if dim meta.
Definition: ncException.h:307
Thrown if invalid dimension size.
Definition: ncException.h:258
Thrown if edge+start exceeds dimension bound.
Definition: ncException.h:216
Thrown if an operation to set the chunking, endianness, fill of a NcVar object is issued after a call...
Definition: ncException.h:427
Thrown if cannot return a netCDF group.
Definition: ncException.h:384
Base object is thrown if a netCDF exception is encountered.
Definition: ncException.h:24
Thrown if, having set NC_NOCLOBBER, the specified dataset already exists.
Definition: ncException.h:56
Thrown if file meta.
Definition: ncException.h:300
Thrown if the action is prohibited on the NC_GLOBAL varid.
Definition: ncException.h:167
Thrown if an error was reported by the HDF5 layer.
Definition: ncException.h:272
Thrown if operation not allowed in defined mode.
Definition: ncException.h:84
Thrown if not a netCDF id.
Definition: ncException.h:63
Index exceeds dimension bound.
Definition: ncException.h:97
Thrown if invalid argument.
Definition: ncException.h:70
Thrown if Nc_MAX_ATTRS is exceeded.
Definition: ncException.h:125
Thrown if NC_MAX_DIMS is exceeded.
Definition: ncException.h:104
Thrown if NC_MAX_NAME is exceeded.
Definition: ncException.h:188
Thrown if NC_MAX_VARS is exceeded.
Definition: ncException.h:153
Thrown if too many netcdf files are open.
Definition: ncException.h:49
Thrown if string match to name is in use.
Definition: ncException.h:111
Thrown if no compound.
Definition: ncException.h:328
Thrown if memory allocation (malloc) failure.
Definition: ncException.h:244
Thrown if nc_rec op when there are no record vars.
Definition: ncException.h:202
Thrown if attribute is not found.
Definition: ncException.h:118
Thrown if operation not allowed in data mode.
Definition: ncException.h:77
Thrown if not a netCDF file.
Definition: ncException.h:174
Thrown if attempting netcdf-4 operation on netcdf-3 file.
Definition: ncException.h:342
Thrown if variable is not found.
Definition: ncException.h:160
Thrown if the requested operation is on a NULL dimension.
Definition: ncException.h:417
Thrown if the requested operation is on a NULL group.
Definition: ncException.h:395
Thrown if the requested operation is on a NULL type.
Definition: ncException.h:406
Thrown if math result not representable.
Definition: ncException.h:237
Thrown if attempting netcdf-4 operation on strict nc3 netcdf-4 file.
Definition: ncException.h:349
Thrown if illegal stride.
Definition: ncException.h:223
Thrown if in FORTRAN, string is too short.
Definition: ncException.h:181
Thrown if file likely truncated or possibly corrupted.
Definition: ncException.h:265
Thrown if cannot find the field id.
Definition: ncException.h:377
Thrown if Nc_UNLIMITED is in the wrong index.
Definition: ncException.h:146
Thrown if NC_UNLIMITED size is already in use.
Definition: ncException.h:195
Thrown if variable meta.
Definition: ncException.h:321
Thrown if one or more variable sizes violate format constraints.
Definition: ncException.h:251
C++ API for netCDF4.
Definition: ncAtt.h:10

Return to the Main Unidata NetCDF page.
Generated on Wed Nov 10 2021 15:25:08 for NetCDF-C++. NetCDF is a Unidata library.