MJD.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: MJD.hpp 1162 2008-03-27 21:18:13Z snelsen $"
00002 
00003 
00004 
00005 #ifndef GPSTK_MJD_HPP
00006 #define GPSTK_MJD_HPP
00007 
00008 //============================================================================
00009 //
00010 //  This file is part of GPSTk, the GPS Toolkit.
00011 //
00012 //  The GPSTk is free software; you can redistribute it and/or modify
00013 //  it under the terms of the GNU Lesser General Public License as published
00014 //  by the Free Software Foundation; either version 2.1 of the License, or
00015 //  any later version.
00016 //
00017 //  The GPSTk is distributed in the hope that it will be useful,
00018 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00019 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020 //  GNU Lesser General Public License for more details.
00021 //
00022 //  You should have received a copy of the GNU Lesser General Public
00023 //  License along with GPSTk; if not, write to the Free Software Foundation,
00024 //  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025 //  
00026 //  Copyright 2004, The University of Texas at Austin
00027 //
00028 //============================================================================
00029 
00030 #include "TimeTag.hpp"
00031 
00032 namespace gpstk
00033 {
00037    class MJD : public TimeTag
00038    {
00039    public:
00049       MJD( long double m = 0. )
00050          throw()
00051             : mjd( m )
00052       {}
00053       
00058       MJD( const MJD& right )
00059          throw()
00060             : mjd( right.mjd )
00061       {}
00062       
00070       MJD( const TimeTag& right )
00071          throw( gpstk::InvalidRequest )
00072       { 
00073          convertFromCommonTime( right.convertToCommonTime() ); 
00074       }
00075       
00083       MJD( const CommonTime& right )
00084          throw()
00085       {
00086          convertFromCommonTime( right );
00087       }
00088 
00094       MJD& operator=( const MJD& right )
00095          throw();
00096       
00098       virtual ~MJD()
00099          throw()
00100       {}
00102 
00103          // The following functions are required by TimeTag.
00104       virtual CommonTime convertToCommonTime() const
00105          throw(InvalidRequest);
00106 
00107       virtual void convertFromCommonTime( const CommonTime& ct )
00108          throw();
00109 
00112       virtual std::string printf( const std::string& fmt ) const
00113          throw( gpstk::StringUtils::StringException );
00114 
00117       virtual std::string printError( const std::string& fmt ) const
00118          throw( gpstk::StringUtils::StringException );
00119 
00126       virtual bool setFromInfo( const IdToValue& info )
00127          throw();
00128       
00131       virtual std::string getPrintChars() const
00132          throw()
00133       { 
00134          return "Q";
00135       }
00136 
00138       virtual std::string getDefaultFormat() const
00139          throw()
00140       {
00141          return "%.9Q";
00142       }
00143 
00144       virtual bool isValid() const
00145          throw();
00146 
00147       virtual void reset() 
00148          throw();
00149 
00158       bool operator==( const MJD& right ) const
00159          throw();
00160       bool operator!=( const MJD& right ) const
00161          throw();
00162       bool operator<( const MJD& right ) const
00163          throw();
00164       bool operator>( const MJD& right ) const
00165          throw();
00166       bool operator<=( const MJD& right ) const
00167          throw();
00168       bool operator>=( const MJD& right ) const
00169          throw();
00171 
00172       long double mjd;
00173    };
00174 
00175 } // namespace
00176 
00177 #endif // GPSTK_MJD_HPP

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