00001 #ifndef RecordStream_NetCDF_h 00002 #define RecordStream_NetCDF_h 00003 00004 #include "RecordInputStream.h" 00005 #include "RecordOutputStream.h" 00006 #include "netcdf.h" 00007 00008 namespace BIE { 00009 class RecordInputStream_NetCDF; 00010 class RecordOutputStream_NetCDF; 00011 } 00012 00013 //+ CLICLASS RecordInputStream_NetCDF SUPER RecordInputStream 00025 class BIE::RecordInputStream_NetCDF : public BIE::RecordInputStream { 00026 00027 public: 00028 //+ CLICONSTR string 00031 RecordInputStream_NetCDF (string filename); 00032 00035 void initialize(); 00036 00039 ~RecordInputStream_NetCDF(); 00040 00043 bool nextRecord(); 00044 00045 //+ CLIMETHOD bool eos 00047 bool eos(); 00048 00049 //+ CLIMETHOD bool error 00051 bool error(); 00052 00053 //+ CLIMETHOD string toString 00055 string toString(); 00056 00057 private: 00059 int risnc_ncid; 00061 bool risnc_eof; 00063 bool risnc_error; 00065 size_t risnc_recordindex; 00067 string risnc_filename; 00069 size_t risnc_numrecords; 00071 bool use_float; 00072 }; 00073 00074 //+ CLICLASS RecordOutputStream_NetCDF SUPER RecordOutputStream 00078 class BIE::RecordOutputStream_NetCDF : public BIE::RecordOutputStream { 00079 00080 public: 00081 //+ CLICONSTR RecordOutputStream* string 00084 RecordOutputStream_NetCDF(RecordOutputStream * stream, string filename); 00085 00086 //+ CLICONSTR RecordOutputStream* string bool 00091 RecordOutputStream_NetCDF(RecordOutputStream * stream, string filename, 00092 bool write_float); 00093 00095 ~RecordOutputStream_NetCDF(); 00096 00098 virtual void pushRecord(); 00099 00100 //+ CLIMETHOD string toString 00102 string toString(); 00103 00105 void close(); 00106 00107 private: 00109 int rosnc_ncid; 00111 size_t rosnc_recordindex; 00113 string rosnc_filename; 00115 bool use_float; 00116 }; 00117 00118 #endif