MSCStore.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: MSCStore.hpp 2223 2010-01-11 16:27:48Z afarris $"
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 2007, The University of Texas at Austin
00022 //
00023 //============================================================================
00024 
00025 //============================================================================
00026 //
00027 //This software developed by Applied Research Laboratories at the University of
00028 //Texas at Austin, under contract to an agency or agencies within the U.S. 
00029 //Department of Defense. The U.S. Government retains all rights to use,
00030 //duplicate, distribute, disclose, or release this software. 
00031 //
00032 //Pursuant to DoD Directive 523024 
00033 //
00034 // DISTRIBUTION STATEMENT A: This software has been approved for public 
00035 //                           release, distribution is unlimited.
00036 //
00037 //=============================================================================
00038 
00046 #ifndef GPSTK_MSCSTORE_HPP
00047 #define GPSTK_MSCSTORE_HPP
00048 
00049 #include <iostream>
00050 #include <string>
00051 #include <list>
00052 #include <map>
00053 
00054 #include "FileStore.hpp"
00055 #include "XvtStore.hpp"
00056 #include "MSCData.hpp"
00057 #include "MSCStream.hpp"
00058 #include "MSCHeader.hpp"
00059 
00060 namespace gpstk
00061 {
00064    
00068    class MSCStore : public XvtStore<std::string>,
00069                     public FileStore<gpstk::MSCHeader>
00070    {
00071    public:
00072 
00073       MSCStore()
00074          throw()
00075          : initialTime(DayTime::END_OF_TIME), 
00076            finalTime(DayTime::END_OF_TIME)
00077       {}
00078 
00079       virtual ~MSCStore()
00080       {}
00081 
00090       Xvt getXvt(const std::string stationID, const DayTime& t)
00091          const throw(InvalidRequest);
00092 
00093 
00102       Xvt getXvt(unsigned long stationIDno, const DayTime& t)
00103          const throw(InvalidRequest);
00104 
00105 
00110       void dump(std::ostream& s = std::cout, short detail = 0)
00111          const throw();
00112 
00113 
00117       void edit(const DayTime& tmin = DayTime(DayTime::BEGINNING_OF_TIME), 
00118                 const DayTime& tmax = DayTime(DayTime::END_OF_TIME) )
00119          throw();
00120 
00125       DayTime getInitialTime()
00126          const throw(InvalidRequest)
00127       {return initialTime;}
00128 
00129       
00134       DayTime getFinalTime()
00135          const throw(InvalidRequest)
00136       {return finalTime;}
00137 
00138       bool velocityIsPresent()
00139          const throw()
00140       {return true;}
00141 
00142 
00143       bool clockIsPresent()
00144          const throw()
00145       {return false;}
00146 
00147       //---------------------------------------------------------------
00148       // FileStore interfaces
00149       //---------------------------------------------------------------
00150       void loadFile(const std::string& filename) 
00151          throw(FileMissingException);    
00152 
00153       //---------------------------------------------------------------
00154       // Below are interfaces that are unique to this class (i.e. not 
00155       // in the parent class)
00156       //---------------------------------------------------------------
00160       bool addMSC(const MSCData& msc)
00161          throw();
00162       
00164       void clear()
00165          throw()
00166       {edit(gpstk::DayTime(gpstk::DayTime::BEGINNING_OF_TIME), 
00167             gpstk::DayTime(gpstk::DayTime::BEGINNING_OF_TIME));}
00168       
00171       unsigned size()
00172          const throw();
00173       
00181       const MSCData& findMSC(const std::string stationID, const DayTime& t)
00182          const throw(InvalidRequest);
00183       const MSCData& findMSC(const unsigned long stationID, const DayTime& t) 
00184          const throw(InvalidRequest);
00185 
00188       int addToList(std::list<MSCData>& v)
00189          const throw();
00190 
00191       // Return a list of the station IDs for all MSCData objects
00192       // currently stored. 
00193       std::list<std::string> getIDList();
00194          
00195    private:
00198       typedef std::map<gpstk::DayTime, MSCData> StaMSCMap;
00199       typedef StaMSCMap::const_iterator SMMci;
00200       typedef StaMSCMap::iterator SMMi;
00201       
00203       typedef std::map<std::string, StaMSCMap> MSCMap;
00204       typedef MSCMap::const_iterator MMci;
00205       typedef MSCMap::iterator MMi;
00206       
00208       MSCMap mscMap;
00209       
00210       DayTime initialTime; //< Time of the first MSCData object
00211       DayTime finalTime;   //< Time of the last MSCData object
00212                            //< (N.B.: finalTime is irrelevant in the 
00213                            //<  current implementation as there is no
00214                            //<  "end of effectivity" for an MSCData object.
00215       
00216       static const double SEC_YEAR;
00217    }; // end class MSCStore
00219    
00220 } // namespace gpstk
00221 #endif  // GPSTK_MSCSTORE_HPP

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