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
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
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
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 }
00176
00177 #endif