NetCDF-C++  4.3.1-developer
ncException.h
1 #include <exception>
2 #include <string>
3 #include <iostream>
4 
5 #ifndef NcExceptionClasses
6 #define NcExceptionClasses
7 
8 namespace 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 
62  class NcInvalidArg : public NcException
63  {
64  public:
65  NcInvalidArg(const char* complaint,const char* file,int line);
66  };
67 
69  class NcInvalidWrite : public NcException
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 
83  class NcInDefineMode : public NcException
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 
110  class NcNameInUse : public NcException
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 
201  class NcNoRecVars : public NcException
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 
285  class NcCantWrite : public NcException
286  {
287  public:
288  NcCantWrite(const char* complaint,const char* file,int line);
289  };
290 
292  class NcCantCreate : public NcException
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 
327  class NcNoCompound : public NcException
328  {
329  public:
330  NcNoCompound(const char* complaint,const char* file,int line);
331  };
332 
334  class NcAttExists : public NcException
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 
348  class NcStrictNc3 : public NcException
349  {
350  public:
351  NcStrictNc3(const char* complaint,const char* file,int line);
352  };
353 
355  class NcBadGroupId : public NcException
356  {
357  public:
358  NcBadGroupId(const char* complaint,const char* file,int line);
359  };
360 
362  class NcBadTypeId : public NcException
363  {
364  public:
365  NcBadTypeId(const char* complaint,const char* file,int line);
366  };
367 
369  class NcBadFieldId : public NcException
370  {
371  public:
372  NcBadFieldId(const char* complaint,const char* file,int line);
373  };
374 
376  class NcUnknownName : public NcException
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 cannot write.
Definition: ncException.h:285
Thrown if NC_MAX_DIMS is exceeded.
Definition: ncException.h:103
Thrown if the requested operation is on a NULL type.
Definition: ncException.h:405
Thrown if NC_UNLIMITED size is already in use.
Definition: ncException.h:194
Thrown if bad field id.
Definition: ncException.h:369
Thrown if attempting netcdf-4 operation on strict nc3 netcdf-4 file.
Definition: ncException.h:348
Thrown if cannot return a netCDF group.
Definition: ncException.h:383
Thrown if bad group id.
Definition: ncException.h:355
Thrown if, having set NC_NOCLOBBER, the specified dataset already exists.
Definition: ncException.h:55
Thrown if invalid dimension size.
Definition: ncException.h:257
Thrown if operation not allowed in data mode.
Definition: ncException.h:76
Thrown if one or more variable sizes violate format constraints.
Definition: ncException.h:250
C++ API for netCDF4.
Definition: ncAtt.h:9
Thrown if not a netCDF file.
Definition: ncException.h:173
Thrown if the action is prohibited on the NC_GLOBAL varid.
Definition: ncException.h:166
Thrown if in FORTRAN, string is too short.
Definition: ncException.h:180
Thrown if attempting netcdf-4 operation on netcdf-3 file.
Definition: ncException.h:341
Thrown if dim meta.
Definition: ncException.h:306
Thrown if not a valid netCDF data type.
Definition: ncException.h:131
Thrown if the requested operation is on a NULL group.
Definition: ncException.h:394
Thrown if string match to name is in use.
Definition: ncException.h:110
Thrown if NC_MAX_VARS is exceeded.
Definition: ncException.h:152
Thrown if attribute is not found.
Definition: ncException.h:117
Thrown if the specified netCDF ID does not refer to an open netCDF dataset.
Definition: ncException.h:41
Thrown if not a netCDF id.
Definition: ncException.h:62
Thrown if an error was reported by the HDF5 layer.
Definition: ncException.h:271
Thrown if too many netcdf files are open.
Definition: ncException.h:48
Thrown if file meta.
Definition: ncException.h:299
Thrown if edge+start exceeds dimension bound.
Definition: ncException.h:215
Thrown if memory allocation (malloc) failure.
Definition: ncException.h:243
Thrown if attempt to convert between text and numbers.
Definition: ncException.h:208
Thrown if cannot create.
Definition: ncException.h:292
Thrown if attribute meta.
Definition: ncException.h:313
Thrown if cannot read.
Definition: ncException.h:278
Thrown if the requested operation is on a NULL dimension.
Definition: ncException.h:416
Thrown if operation not allowed in defined mode.
Definition: ncException.h:83
Base object is thrown if a netCDF exception is encountered.
Definition: ncException.h:24
Thrown if illegal stride.
Definition: ncException.h:222
Thrown if NC_MAX_NAME is exceeded.
Definition: ncException.h:187
Index exceeds dimension bound.
Definition: ncException.h:96
Thrown if Nc_MAX_ATTRS is exceeded.
Definition: ncException.h:124
Thrown if an operation to set the chunking, endianness, fill of a NcVar object is issued after a call...
Definition: ncException.h:426
Thrown if cannot find the field id.
Definition: ncException.h:376
Thrown if attribute exists.
Definition: ncException.h:334
Thrown if math result not representable.
Definition: ncException.h:236
Thrown if bad type id.
Definition: ncException.h:362
Thrown if file likely truncated or possibly corrupted.
Definition: ncException.h:264
Thrown if Nc_UNLIMITED is in the wrong index.
Definition: ncException.h:145
Thrown if no compound.
Definition: ncException.h:327
Thrown if nc_rec op when there are no record vars.
Definition: ncException.h:201
Thrown if invalid argument.
Definition: ncException.h:69
Thrown if attribute or variable name contains illegal characters.
Definition: ncException.h:229
Thrown if variable is not found.
Definition: ncException.h:159
Thrown if an invalid dimension id or name.
Definition: ncException.h:138
Thrown if variable meta.
Definition: ncException.h:320

Return to the Main Unidata NetCDF page.
Generated on Fri Nov 11 2016 15:28:29 for NetCDF-C++. NetCDF is a Unidata library.