// // C++ Interface: %{MODULE} // // Description: // // // Author: %{AUTHOR} <%{EMAIL}>, (C) %{YEAR} // // Copyright: See COPYING file that comes with this distribution // // #ifndef NETCDFFILEDATA_H #define NETCDFFILEDATA_H #include #include #include "Hdf_file.hpp" #include "filedataexception.h" #include "statistic.h" #include "filedatareader.h" //using namespace std; /** @author James MANLEY */ class NETCDFFileData : public FileDataReader{ public: NETCDFFileData(const string &filename, const string &mode); //NETCDFFileData::NETCDFFileData( const NETCDFFileData & hfd ); virtual ~NETCDFFileData(); virtual void* read_data(void* data, const char* sds_name, int * start=NULL, int * stride=NULL, int *edges=NULL, int rank=-1); virtual vector get_dataset_dimension(const string &sds_name); virtual bool dataset_exists(const char *sds_name); void get_dataset_fill_value(const string &sds_name, void* fill_value); int get_n_dataset(); string get_dataset_name(int i); int get_dataset_data_type(string sds_name); string get_values_attr_dataset(string sds_name,string attr_name); bool has_attr_dataset(string sds_name,string attr_name); /** * @brief closes the file */ void close_data_file(){SDend(ncfile);ncfile=-1;}; /** * @brief open the file */ void open_data_file(); protected: int32 ncfile; string filename; const bool check_read_write_limits(const char* sds_name, int *start, int *stride, int *edges, const int rank); void init_read_write_null_input_param(const char* sds_name, int *&start, int *&stride, int *&edges, int &rank, bool * initialized_values); void free_read_write_allocations( const bool *are_limits_initialized, int *start, int *stride, int *edges ); Hdf_sds get_dataset(string sds_name); }; #endif