DCBDataReader.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: DCBDataReader.hpp 2551 2011-04-11 14:29:33Z yanweignss $"
00002 
00008 #ifndef GPSTK_DCBDATAREADER_HPP
00009 #define GPSTK_DCBDATAREADER_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 //  Wei Yan - Chinese Academy of Sciences  2009, 2010
00030 //
00031 //============================================================================
00032 
00033 
00034 #include <string>
00035 #include <map>
00036 
00037 #include "Exception.hpp"
00038 #include "FFTextStream.hpp"
00039 #include "StringUtils.hpp"
00040 #include "DayTime.hpp"
00041 #include "SatID.hpp"
00042 
00043 using namespace std;
00044 
00045 namespace gpstk
00046 {
00047 
00050 
00077    class DCBDataReader : public FFTextStream
00078    {
00079    public:
00081       DCBDataReader()
00082       {};
00083          
00090       DCBDataReader(const char* fn)
00091          : FFTextStream(fn, std::ios::in)
00092       { loadData(); };
00093 
00094 
00101       DCBDataReader(const string& fn)
00102          : FFTextStream(fn.c_str(), std::ios::in)
00103       { loadData(); };
00104 
00105 
00107       virtual void open(const char* fn);
00108 
00109 
00112       virtual void open(const string& fn);
00113 
00114 
00118       double getDCB( const SatID& sat);
00119 
00124       double getDCB(const int& prn,
00125          const SatID::SatelliteSystem& system = SatID::systemGPS);
00126 
00127 
00132       double getDCB(const string& station,
00133          const SatID::SatelliteSystem& system = SatID::systemGPS);
00134 
00135 
00137       virtual ~DCBDataReader() {};
00138 
00139 
00140    private:
00141 
00142          // Map holding satellite DCB data
00143       typedef std::map< SatID, double > SatDCBData;
00144       
00145          // Map holding receiver DCB data
00146       typedef std::map< string, double > ReceiverDCBData;
00147          
00149       struct DailyDCBData
00150       {
00151          SatDCBData        satDCB;
00152 
00153          ReceiverDCBData   gpsDCB;
00154 
00155          ReceiverDCBData   glonassDCB; 
00156       };
00157 
00159       DailyDCBData allDCB;
00160 
00161 
00163       virtual void loadData()
00164          throw( FFStreamError, gpstk::StringUtils::StringException );
00165 
00166 
00167    };  // End of class 'DCBDataReader'
00168 
00170 
00171 }  // End of namespace gpstk
00172 
00173 #endif  // GPSTK_DCBDATAREADER_HPP
00174 
00175 
00176 
00177 

Generated on Tue May 22 03:30:57 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1