Last change
on this file since 498 was
498,
checked in by mhnguyen, 10 years ago
|
Making a wrapper of NetCdf? C functions
+) Add a wrapper class for NetCdf? functions
+) Add a class to manage exception for NetCdf? functions
+) Replace direct call to netcdf functions by functions of the wrapper
Test
+) On Curie
+) In case of error, exception is thrown and more information is provided
|
File size:
716 bytes
|
Line | |
---|
1 | /*! |
---|
2 | \file netCdfException.hpp |
---|
3 | \author Ha NGUYEN |
---|
4 | \date 08 Oct 2014 |
---|
5 | \since 07 Oct 2014 |
---|
6 | |
---|
7 | \brief Exception management. |
---|
8 | */ |
---|
9 | #ifndef __NETCDF_EXCEPTION_HPP__ |
---|
10 | #define __NETCDF_EXCEPTION_HPP__ |
---|
11 | |
---|
12 | #include <iostream> |
---|
13 | #include <exception> |
---|
14 | |
---|
15 | namespace xios |
---|
16 | { |
---|
17 | /*! |
---|
18 | \class CNetCdfException |
---|
19 | This class manages exceptions risen by CNetCdfInterface |
---|
20 | */ |
---|
21 | class CNetCdfException : public virtual std::exception |
---|
22 | { |
---|
23 | public: |
---|
24 | CNetCdfException(const std::string& ss) : exStr_(ss) {} |
---|
25 | CNetCdfException(const CNetCdfException& netEx) : exStr_(netEx.exStr_) {} |
---|
26 | ~CNetCdfException() throw() {} |
---|
27 | const char* what() const throw() { return exStr_.c_str();} |
---|
28 | protected: |
---|
29 | std::string exStr_; |
---|
30 | }; |
---|
31 | |
---|
32 | } |
---|
33 | |
---|
34 | #endif // __NETCDF_EXCEPTION_HPP__ |
---|
Note: See
TracBrowser
for help on using the repository browser.