EpochDataStore.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: EpochDataStore.hpp 2544 2011-04-07 05:31:19Z yanweignss $"
00002 
00008 #ifndef GPSTK_EPOCHDATASTORE_HPP
00009 #define GPSTK_EPOCHDATASTORE_HPP
00010 
00011 
00012 //============================================================================
00013 //
00014 //  This file is part of GPSTk, the GPS Toolkit.
00015 //
00016 //  The GPSTk is free software; you can redistribute it and/or modify
00017 //  it under the terms of the GNU Lesser General Public License as published
00018 //  by the Free Software Foundation; either version 2.1 of the License, or
00019 //  any later version.
00020 //
00021 //  The GPSTk is distributed in the hope that it will be useful,
00022 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00023 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00024 //  GNU Lesser General Public License for more details.
00025 //
00026 //  You should have received a copy of the GNU Lesser General Public
00027 //  License along with GPSTk; if not, write to the Free Software Foundation,
00028 //  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00029 //
00030 //  Wei Yan - Chinese Academy of Sciences . 2009, 2010, 2011
00031 //
00032 //============================================================================
00033 
00034 
00035 #include <iostream>
00036 #include <string>
00037 #include <set>
00038 #include <map>
00039 #include "DayTime.hpp"
00040 
00041 
00042 namespace gpstk
00043 {
00044    
00047 
00051    class EpochDataStore
00052    {
00053    public:
00054 
00056       typedef std::set<DayTime> EpochList;
00057       typedef std::map<DayTime, std::vector<double> > EpochData;
00058       
00059 
00061       EpochDataStore()
00062          : initialTime(DayTime::END_OF_TIME),
00063            finalTime(DayTime::BEGINNING_OF_TIME),
00064            interPoints(10)
00065       {}
00066 
00067       EpochDataStore(int interpolationPoints)
00068          : initialTime(DayTime::END_OF_TIME),
00069          finalTime(DayTime::BEGINNING_OF_TIME),
00070          interPoints(interpolationPoints)
00071       {}
00072 
00074       virtual ~EpochDataStore()
00075       { allData.clear(); }
00076          
00078       EpochList epochList();
00079 
00080       bool isEpochExist(DayTime t)
00081       { return (allData.find(t) != allData.end()) ? true : false ; }
00082       
00084       void clear()
00085       { allData.clear(); }
00086 
00093       virtual void edit(DayTime tmin, 
00094                         DayTime tmax = DayTime(DayTime::END_OF_TIME));
00095 
00097       size_t size(void)
00098       { return allData.size(); }
00099 
00105       virtual DayTime getInitialTime()
00106       { return initialTime; };
00107 
00108 
00114       virtual DayTime getFinalTime()
00115       { return finalTime; };
00116 
00117 
00118       EpochDataStore& setInterpolationPoints(const int& n)
00119       { interPoints = n; return (*this); }
00120 
00121 
00122    protected:
00123 
00125       void addData(const DayTime& time,const std::vector<double>& data);
00126 
00127 
00134       std::vector<double> getData(const DayTime& t) const
00135          throw(InvalidRequest);
00136 
00137       
00139       EpochData allData;
00140          
00143       DayTime initialTime;
00144       DayTime finalTime;
00145       
00147       int interPoints;
00148 
00149    }; // End of class 'EpochDataStore'
00150 
00151       // @}
00152 
00153 }  // End of namespace gpstk
00154 
00155 
00156 #endif   // GPSTK_EPOCH_DATA_STORE_HPP
00157 
00158 
00159 
00160 
00161 
00162 

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