BLQDataReader.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: BLQDataReader.hpp 1717 2009-02-22 10:42:34Z architest $"
00002 
00008 #ifndef GPSTK_BLQDATAREADER_HPP
00009 #define GPSTK_BLQDATAREADER_HPP
00010 
00011 //============================================================================
00012 //
00013 //  This file is part of GPSTk, the GPS Toolkit.
00014 //
00015 //  The GPSTk is free software; you can redistribute it and/or modify
00016 //  it under the terms of the GNU Lesser General Public License as published
00017 //  by the Free Software Foundation; either version 2.1 of the License, or
00018 //  any later version.
00019 //
00020 //  The GPSTk is distributed in the hope that it will be useful,
00021 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 //  GNU Lesser General Public License for more details.
00024 //
00025 //  You should have received a copy of the GNU Lesser General Public
00026 //  License along with GPSTk; if not, write to the Free Software Foundation,
00027 //  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00028 //
00029 //  Dagoberto Salazar - gAGE ( http://www.gage.es ). 2007, 2009
00030 //
00031 //============================================================================
00032 
00033 
00034 
00035 #include <string>
00036 #include <map>
00037 
00038 #include "FFTextStream.hpp"
00039 #include "StringUtils.hpp"
00040 #include "Matrix.hpp"
00041 
00042 
00043 using namespace std;
00044 
00045 namespace gpstk
00046 {
00049 
00096    class BLQDataReader : public FFTextStream
00097    {
00098    public:
00099 
00101       BLQDataReader()
00102       {};
00103 
00110       BLQDataReader(const char* fn)
00111          : FFTextStream(fn, std::ios::in)
00112       { loadData(); };
00113 
00114 
00121       BLQDataReader(const string& fn)
00122          : FFTextStream(fn.c_str(), std::ios::in)
00123       { loadData(); };
00124 
00125 
00128       virtual void open(const char* fn);
00129 
00130 
00133       virtual void open(const string& fn);
00134 
00135 
00137       virtual BLQDataReader& clearData()
00138       { OceanTidesData.clear(); return (*this); };
00139 
00140 
00152       virtual Matrix<double> getTideHarmonics(const string& station);
00153 
00154 
00156       virtual ~BLQDataReader() {};
00157 
00158 
00159    private:
00160 
00161 
00163       struct tideData
00164       {
00165             // Default constructor initializing the data in the structure
00166          tideData() : harmonics(6,11,0.0) {};
00167 
00168          Matrix<double> harmonics;   
00169       };
00170 
00171 
00173       typedef std::map<string, tideData>::const_iterator tideDataIt;
00174 
00175 
00177       std::map<string, tideData> OceanTidesData;
00178 
00179 
00186       void setData( const string& stationName,
00187                     const tideData& data )
00188       { OceanTidesData.insert(pair<string, tideData>(stationName, data)); };
00189 
00190 
00192       virtual void loadData(void)
00193          throw( FFStreamError, gpstk::StringUtils::StringException );
00194 
00195 
00196    }; // End of class 'BLQDataReader'
00197 
00198 
00200 
00201 }  // End of namespace gpstk
00202 
00203 #endif  // GPSTK_BLQDATAREADER_HPP

Generated on Wed Feb 8 03:30:57 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1