00001 #pragma ident "$Id: YDSTime.hpp 1162 2008-03-27 21:18:13Z snelsen $"
00002
00003
00004
00005 #ifndef GPSTK_YDSTIME_HPP
00006 #define GPSTK_YDSTIME_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 {
00038 class YDSTime : public TimeTag
00039 {
00040 public:
00050 YDSTime( long y = 0,
00051 long d = 0,
00052 double s = 0.)
00053 throw()
00054 : year(y), doy(d), sod(s)
00055 {}
00056
00060 YDSTime( const YDSTime& right )
00061 throw()
00062 : year( right.year ), doy( right.doy ), sod( right.sod )
00063 {}
00064
00072 YDSTime( const TimeTag& right )
00073 throw( InvalidRequest )
00074 {
00075 convertFromCommonTime( right.convertToCommonTime() );
00076 }
00077
00085 YDSTime( const CommonTime& right )
00086 throw()
00087 {
00088 convertFromCommonTime( right );
00089 }
00090
00096 YDSTime& operator=( const YDSTime& right )
00097 throw();
00098
00100 virtual ~YDSTime()
00101 throw()
00102 {}
00104
00105
00106 virtual CommonTime convertToCommonTime() const
00107 throw(InvalidRequest);
00108
00109 virtual void convertFromCommonTime( const CommonTime& ct )
00110 throw();
00111
00114 virtual std::string printf( const std::string& fmt ) const
00115 throw( gpstk::StringUtils::StringException );
00116
00119 virtual std::string printError( const std::string& fmt ) const
00120 throw( gpstk::StringUtils::StringException );
00121
00128 virtual bool setFromInfo( const IdToValue& info )
00129 throw();
00130
00133 virtual std::string getPrintChars() const
00134 throw()
00135 {
00136 return "Yyjs";
00137 }
00138
00140 virtual std::string getDefaultFormat() const
00141 throw()
00142 {
00143 return "%04Y/%03j %s";
00144 }
00145
00146 virtual bool isValid() const
00147 throw();
00148
00149 virtual void reset()
00150 throw();
00151
00160 bool operator==( const YDSTime& right ) const
00161 throw();
00162 bool operator!=( const YDSTime& right ) const
00163 throw();
00164 bool operator<( const YDSTime& right ) const
00165 throw();
00166 bool operator>( const YDSTime& right ) const
00167 throw();
00168 bool operator<=( const YDSTime& right ) const
00169 throw();
00170 bool operator>=( const YDSTime& right ) const
00171 throw();
00173
00174 int year;
00175 int doy;
00176 double sod;
00177 };
00178
00179 }
00180
00181 #endif