00001 #pragma ident "$Id: MSCStore.hpp 2223 2010-01-11 16:27:48Z afarris $"
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
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
00149
00150 void loadFile(const std::string& filename)
00151 throw(FileMissingException);
00152
00153
00154
00155
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
00192
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;
00211 DayTime finalTime;
00212
00213
00214
00215
00216 static const double SEC_YEAR;
00217 };
00219
00220 }
00221 #endif