Synchronize.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: Synchronize.hpp 2584 2011-05-04 01:58:57Z yanweignss $"
00002 
00008 #ifndef SYNCHRONIZE_HPP
00009 #define SYNCHRONIZE_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 //  Dagoberto Salazar - gAGE ( http://www.gage.es ). 2008
00030 //
00031 //============================================================================
00032 
00033 #include <list>
00034 #include "Exception.hpp"
00035 #include "ProcessingClass.hpp"
00036 
00037 
00038 
00039 namespace gpstk
00040 {
00041 
00044    NEW_EXCEPTION_CLASS(SynchronizeException, gpstk::Exception);
00045 
00046 
00049 
00050 
00147    class Synchronize : public ProcessingClass
00148    {
00149    public:
00150 
00152       Synchronize()
00153          : pRinexRef(NULL), pgRov1(NULL), tolerance(1.0),
00154            firstTime(true)
00155       { setIndex(); };
00156 
00157 
00164       Synchronize( RinexObsStream& rinexObs,
00165                    gnssRinex& roverData,
00166                    const double tol = 1.0 )
00167          : tolerance(tol), firstTime(true)
00168       { setReferenceSource(rinexObs); setRoverData(roverData); setIndex(); };
00169 
00170 
00177       Synchronize( RinexObsStream& rinexObs,
00178                    gnssSatTypeValue& roverData,
00179                    const double tol = 1.0 )
00180          : tolerance(tol), firstTime(true)
00181       { setReferenceSource(rinexObs); setRoverData(roverData); setIndex(); };
00182 
00183 
00189       virtual gnssSatTypeValue& Process(gnssSatTypeValue& gData)
00190          throw(SynchronizeException);
00191 
00192 
00198       virtual gnssRinex& Process(gnssRinex& gData)
00199          throw(SynchronizeException);
00200 
00201 
00203       virtual double getTolerance(void) const
00204       { return tolerance; };
00205 
00206 
00211       virtual Synchronize& setTolerance(const double tol);
00212 
00213 
00215       virtual RinexObsStream* getPtrReferenceSource(void) const
00216       { return pRinexRef; };
00217 
00218 
00223       virtual Synchronize& setReferenceSource(RinexObsStream& rinexObs)
00224       { pRinexRef = &rinexObs; firstTime=true; return (*this); }
00225 
00226 
00231       virtual Synchronize& setRoverData(gnssRinex& roverData)
00232       { pgRov1 = (gnssSatTypeValue*)(&roverData); return (*this); }
00233 
00234 
00239       virtual Synchronize& setRoverData(gnssSatTypeValue& roverData)
00240       { pgRov1 = &roverData; return (*this); }
00241 
00242 
00244       virtual int getIndex(void) const;
00245 
00246 
00248       virtual std::string getClassName(void) const;
00249 
00250 
00252       virtual ~Synchronize() {};
00253 
00254 
00255    protected:
00256 
00257       virtual gnssRinex& Process(DayTime time, gnssRinex& gData)
00258          throw(SynchronizeException);
00259 
00260 
00262       std::list<gnssRinex> gnssRinexBuffer;
00263 
00264 
00266       RinexObsStream* pRinexRef;
00267 
00268 
00270       gnssSatTypeValue* pgRov1;
00271 
00272 
00274       double tolerance;
00275 
00277       bool firstTime;
00278 
00280       static int classIndex;
00281 
00283       int index;
00284 
00286       void setIndex(void)
00287       { index = classIndex++; };
00288 
00289 
00290    }; // End of class 'Synchronize'
00291 
00293 
00294 }  // End of namespace gpstk
00295 #endif   // SYNCHRONIZE_HPP

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