Last change
on this file since 5600 was
5600,
checked in by jack, 16 years ago
|
More restructuring to use boost::shared_ptr.
|
File size:
1.1 KB
|
Rev | Line | |
---|
[5488] | 1 | #ifndef SWW_FILE_HH |
---|
| 2 | #define SWW_FILE_HH |
---|
[5487] | 3 | |
---|
| 4 | /* A simple read-only wrapper around the NetCDF C calls, since it's |
---|
| 5 | difficult to build the C++ binding on Win32 (further, it fails its |
---|
| 6 | test suite. */ |
---|
[5490] | 7 | #ifdef HAVE_CONFIG_H |
---|
| 8 | # include "config.h" |
---|
| 9 | #endif |
---|
| 10 | #include <string> |
---|
| 11 | #ifdef HAVE_SYS_TYPES_H |
---|
| 12 | # include <sys/types.h> |
---|
| 13 | #endif |
---|
| 14 | #include <boost/shared_array.hpp> |
---|
[5487] | 15 | |
---|
[5490] | 16 | using boost::shared_array; |
---|
[5487] | 17 | using std::string; |
---|
| 18 | |
---|
[5488] | 19 | class SWWFile{ |
---|
[5600] | 20 | friend class HeightQuantity; |
---|
[5487] | 21 | public: |
---|
[5488] | 22 | SWWFile(const string &file_name); |
---|
| 23 | ~SWWFile(void); |
---|
[5502] | 24 | int nc_inq_varndims_by_name(const string &name) const; |
---|
[5487] | 25 | private: |
---|
[5502] | 26 | void nc_get_var_float_by_name(const string &name, float array[]) const; |
---|
| 27 | void nc_get_var_int_by_name(const string &name, int array[]) const; |
---|
| 28 | size_t nc_inq_dimlen_by_name(const string &name) const; |
---|
[5490] | 29 | void compute_extents(void); |
---|
[5487] | 30 | int netcdf_id; |
---|
[5490] | 31 | int number_of_points; |
---|
[5493] | 32 | int number_of_timesteps; |
---|
[5490] | 33 | int number_of_vertices; |
---|
| 34 | int number_of_volumes; |
---|
| 35 | shared_array<float> x; |
---|
| 36 | shared_array<float> y; |
---|
| 37 | shared_array<int> volumes; |
---|
| 38 | float minX; |
---|
| 39 | float maxX; |
---|
| 40 | float minY; |
---|
| 41 | float maxY; |
---|
[5487] | 42 | }; |
---|
| 43 | |
---|
| 44 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.