• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

/home/pascal/depot/filedata/src/filedata.h

00001 /***************************************************************************
00002  *   Copyright (C) 2005 by Nicolas PASCAL                                  *
00003  *   nicolas.pascal@icare.univ-lille1.fr                                   *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 
00021 /***************************************************************************
00022  *  History :                                                              *
00023  *  25/07/05 : start                                                       *
00024  ***************************************************************************/
00025 
00026 #ifndef FILEDATA_H
00027 #define FILEDATA_H
00028 
00029 #include "g_exception.h"
00030 #include "filedataexception.h"
00031 #include "statistic.h"
00032 #include "geometry.h"
00033 #include "observation.h"
00034 
00040 class FileData {
00041 protected:
00045     string name;
00049     string mode;
00053     Date *date;
00057     double time_coverage;
00062     void set_name( const string & name ) { this->name=name; };
00067     void set_date(const Date& d) {
00068         if (&d!=NULL)
00069             *date = d;
00070     };
00071 public:
00081     FileData(const string &name = "",const string &mode = "r");
00086     FileData(const FileData &fd);
00087 
00093     FileData &operator= (const FileData &fd);
00097     virtual ~FileData();
00102     const string get_name() const { return name; };
00107     virtual string get_filename(){
00108          return get_name();
00109     };
00114     const Date get_date() const { return *date; }
00121     const bool contain_time(const double time=-1.) const;
00122 
00134     virtual void* read_data(void* data, const char* sds_name, int * start = NULL, int * stride = NULL, int * edges = NULL, int rank = -1) = 0;
00135 
00136     double get_time_coverage() const {
00137         return time_coverage;
00138     };
00143     virtual void close_data_file() {
00144         UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00145         throw e;
00146     };
00151     virtual void open_data_file() {
00152         UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00153         throw e;
00154     };
00163     virtual const bool contain_location(const float &lat,const float &lon, const double &tolerance) {
00164         UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00165         throw e;
00166     };
00178     virtual const bool contain_data(const float &lat, const float &lon, const double &time, const double &colocation_tolerance) {
00179         UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00180         throw e;
00181     };
00187     static void check_geolocation (const float lat, const float lon);
00193     virtual void load_geolocation_data() {
00194         UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00195         throw e;
00196     };;
00201     virtual void free_geolocation_data() {
00202         UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00203         throw e;
00204     };;
00209     virtual const bool is_geolocation_data_loaded() const {
00210         UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00211         throw e;
00212     };
00219     virtual void get_dataset_fill_value(const string &ds_name, void * fillvalue) {
00220         UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00221         throw e;
00222     };
00228     virtual vector<int> get_dataset_dimension(const string &sds_name) {
00229         UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00230         throw e;
00231     };
00237     template<class X>
00238     void get_fillValue(const string & ds_name, X & fillValue) {
00239         get_fillValue(ds_name, (void*)&fillValue);
00240     };
00241     virtual void get_fillValue(const string &ds_name, void *fillValue) {
00242         UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00243         throw e;
00244     };
00245     template<class X>
00246     void get_fill_value(const string & ds_name, X & fillValue) {
00247         get_fill_value(ds_name, (void*)&fillValue);
00248     };
00249     virtual void get_fill_value(const string &ds_name, void * fillValue) {
00250         get_fillValue(ds_name, (void*)&fillValue);
00251     };
00255     virtual bool is_viewing_directions_data_loaded() {
00256         UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00257         throw e;
00258     };
00262     virtual void load_viewing_directions_data () {
00263         UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00264         throw e;
00265     };
00269     virtual void free_viewing_directions_data () {
00270         UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00271         throw e;
00272     };
00278     virtual void get_viewing_directions (const vector <int> & ipix, vector <Observation> & v_obs) {
00279         UnimplementedMethod e(__FILE__,__LINE__,__PRETTY_FUNCTION__);
00280         throw e;
00281     };
00282 };
00283 
00284 #endif
00285 

Generated on Thu Feb 14 2013 17:59:03 for filedata.kdevelop by  doxygen 1.7.1