GPSEphemerisStore.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: GPSEphemerisStore.hpp 2741 2011-06-22 16:37:02Z nwu $"
00002 
00003 //============================================================================
00004 //
00005 //  This file is part of GPSTk, the GPS Toolkit.
00006 //
00007 //  The GPSTk is free software; you can redistribute it and/or modify
00008 //  it under the terms of the GNU Lesser General Public License as published
00009 //  by the Free Software Foundation; either version 2.1 of the License, or
00010 //  any later version.
00011 //
00012 //  The GPSTk is distributed in the hope that it will be useful,
00013 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 //  GNU Lesser General Public License for more details.
00016 //
00017 //  You should have received a copy of the GNU Lesser General Public
00018 //  License along with GPSTk; if not, write to the Free Software Foundation,
00019 //  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 //
00021 //  Copyright 2004, The University of Texas at Austin
00022 //
00023 //============================================================================
00024 //============================================================================
00025 //
00026 //This software developed by Applied Research Laboratories at the University of
00027 //Texas at Austin, under contract to an agency or agencies within the U.S.
00028 //Department of Defense. The U.S. Government retains all rights to use,
00029 //duplicate, distribute, disclose, or release this software.
00030 //
00031 //Pursuant to DoD Directive 523024
00032 //
00033 // DISTRIBUTION STATEMENT A: This software has been approved for public
00034 //                           release, distribution is unlimited.
00035 //
00036 //=============================================================================
00037 
00045 #ifndef GPSTK_GPSEPHEMERISSTORE_HPP
00046 #define GPSTK_GPSEPHEMERISSTORE_HPP
00047 
00048 #include <iostream>
00049 #include <string>
00050 #include <list>
00051 #include <map>
00052 
00053 #include "XvtStore.hpp"
00054 #include "SatID.hpp"
00055 #include "EngEphemeris.hpp"
00056 #include "icd_200_constants.hpp"
00057 
00058 namespace gpstk
00059 {
00062 
00066    class GPSEphemerisStore : public XvtStore<SatID>
00067    {
00068    public:
00069 
00070       GPSEphemerisStore()
00071          throw()
00072          : initialTime(DayTime::END_OF_TIME),
00073            finalTime(DayTime::BEGINNING_OF_TIME),
00074            method(0)
00075       {}
00076 
00077 
00078       virtual ~GPSEphemerisStore()
00079       {}
00080 
00081 
00090       Xvt getXvt(const SatID sat, const DayTime& t)
00091          const throw(InvalidRequest);
00092 
00093 
00098       void dump(std::ostream& s = std::cout, short detail = 0)
00099          const throw();
00100 
00101 
00105       void edit(const DayTime& tmin,
00106                 const DayTime& tmax = DayTime(DayTime::END_OF_TIME) )
00107          throw();
00108 
00109 
00114       DayTime getInitialTime()
00115          const throw(InvalidRequest)
00116       {return initialTime;}
00117 
00118 
00123       DayTime getFinalTime()
00124          const throw(InvalidRequest)
00125       {return finalTime;}
00126 
00127 
00128       bool velocityIsPresent()
00129          const throw()
00130       {return true;}
00131 
00132 
00133       bool clockIsPresent()
00134          const throw()
00135       {return true;}
00136 
00137 
00138       //---------------------------------------------------------------
00139       // Below are interfaces that are unique to this class (i.e. not
00140       // in the parent class)
00141       //---------------------------------------------------------------
00142 
00148       short getSatHealth(const SatID sat, const DayTime& t)
00149          const throw(InvalidRequest);
00150 
00151 
00155       bool addEphemeris(const EngEphemeris& eph)
00156          throw();
00157 
00158 
00161       void wiper(const DayTime& t)
00162          throw()
00163       {edit(t);}
00164 
00166       void clear()
00167          throw()
00168       {edit(DayTime(DayTime::END_OF_TIME));}
00169 
00177       Xvt getXvt(const SatID sat, const DayTime& t, short& ref)
00178          const throw(InvalidRequest);
00179 
00182       unsigned ubeSize()
00183          const throw();
00184 
00185       unsigned size()
00186          const throw()
00187       { return ubeSize(); };
00188 
00195       const EngEphemeris& findEphemeris(const SatID sat, const DayTime& t)
00196          const throw(InvalidRequest);
00197 
00206       const EngEphemeris& findUserEphemeris(const SatID sat, const DayTime& t)
00207          const throw(InvalidRequest);
00208 
00216       const EngEphemeris& findNearEphemeris(const SatID sat, const DayTime& t)
00217          const throw(InvalidRequest);
00218 
00221       int addToList(std::list<EngEphemeris>& v)
00222          const throw();
00223 
00225       void SearchNear(void)
00226          throw()
00227       {method = 1;}
00228 
00230       void SearchPast(void)
00231          throw()
00232       {method = 0;}
00233 
00236       typedef std::map<DayTime, EngEphemeris> EngEphMap;
00237 
00242       const EngEphMap& getEphMap( const SatID sat )
00243                const throw(InvalidRequest);
00244 
00245    protected:
00246        void validSatSystem(const SatID sat)
00247            const throw(InvalidRequest)
00248        {
00249            InvalidRequest ire( std::string("Try to get NONE GPS sat position ")
00250                + std::string("from GPSEphemerisStore, and it's forbidden!") );
00251 
00252            if(sat.system!=SatID::systemGPS) GPSTK_THROW(ire);
00253        }
00254 
00255    private:
00256 
00259       typedef std::map<short, EngEphMap> UBEMap;
00260 
00262       UBEMap ube;
00263 
00264       DayTime initialTime; //< Time of the first EngEphemeris
00265       DayTime finalTime;   //< Time of the last EngEphemeris
00266 
00269       int method;
00270 
00271    }; // end class GPSEphemerisStore
00273 
00274 } // namespace gpstk
00275 #endif  // GPSTK_GPSEPHEMERISSTORE_HPP

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