/* VInput.h */ /* remap Copyright (C) 2006 Fabrice Ducos, fabrice.ducos@icare.univ-lille1.fr This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef VInput_H #define VInput_H #include #include #include #include #include "common.h" #include "grid.h" #include "VError.h" #include "debug.h" class VInput { public: VInput() { PDEBUG; lat_ = NULL; lon_ = NULL; time_ = NULL; data_ = NULL; data_type_code_ = 0; } virtual ~VInput() { PDEBUG; } virtual coord_type *lat() const { return lat_; } virtual coord_type *lon() const { return lon_; } virtual time_type *time() const { return time_; } // time_type is float64 (in TAI93) virtual void *data() const { return data_; } virtual int32 data_type_code() const { return data_type_code_; } virtual grid_content_type content() const { return content_; } virtual double wavelength() const { return wavelength_; } virtual std::vector dimensions() const { return dimensions_; }; virtual int rank() const { return dimensions().size(); } virtual int dimension(int idim) const { assert(idim >= 0 && idim < rank()); std::vector dim = dimensions(); return dim[idim]; } protected: std::vector dimensions_; grid_content_type content_; double wavelength_; coord_type *lat_; coord_type *lon_; time_type *time_; void *data_; int32 data_type_code_; }; #endif