00001 #pragma ident "$Id: GPSWeekSecond.hpp 1162 2008-03-27 21:18:13Z snelsen $"
00002
00003
00004
00005 #ifndef GPSTK_GPSWEEKSECOND_HPP
00006 #define GPSTK_GPSWEEKSECOND_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 "GPSWeek.hpp"
00031 #include "TimeConstants.hpp"
00032
00033 namespace gpstk
00034 {
00039 class GPSWeekSecond : public GPSWeek
00040 {
00041 public:
00051 GPSWeekSecond( unsigned int w = 0,
00052 double s = 0. )
00053 throw()
00054 : GPSWeek(w), sow(s)
00055 {}
00056
00061 GPSWeekSecond( const GPSWeekSecond& right )
00062 throw()
00063 : GPSWeek( right ), sow( right.sow )
00064 {}
00065
00073 GPSWeekSecond( const TimeTag& right )
00074 throw( gpstk::InvalidRequest )
00075 {
00076 convertFromCommonTime( right.convertToCommonTime() );
00077 }
00078
00086 GPSWeekSecond( const CommonTime& right )
00087 throw( InvalidRequest )
00088 {
00089 convertFromCommonTime( right );
00090 }
00091
00097 GPSWeekSecond& operator=( const GPSWeekSecond& right )
00098 throw();
00099
00101 virtual ~GPSWeekSecond()
00102 throw()
00103 {}
00105
00106
00107 virtual CommonTime convertToCommonTime() const
00108 throw(InvalidRequest);
00109
00110 virtual void convertFromCommonTime( const CommonTime& ct )
00111 throw(InvalidRequest);
00112
00115 virtual std::string printf( const std::string& fmt ) const
00116 throw( gpstk::StringUtils::StringException );
00117
00120 virtual std::string printError( const std::string& fmt ) const
00121 throw( gpstk::StringUtils::StringException );
00122
00129 virtual bool setFromInfo( const IdToValue& info )
00130 throw();
00131
00134 virtual std::string getPrintChars() const
00135 throw()
00136 {
00137 return GPSWeek::getPrintChars() + "wg";
00138 }
00139
00141 virtual std::string getDefaultFormat() const
00142 throw()
00143 {
00144 return GPSWeek::getDefaultFormat() + " %010.3g";
00145 }
00146
00147 virtual bool isValid() const
00148 throw();
00149
00150 virtual void reset()
00151 throw();
00152
00153 inline virtual unsigned int getDayOfWeek() const
00154 throw()
00155 {
00156 return static_cast<unsigned int>(sow) / SEC_PER_DAY;
00157 }
00158
00167 bool operator==( const GPSWeekSecond& right ) const
00168 throw();
00169 bool operator!=( const GPSWeekSecond& right ) const
00170 throw();
00171 bool operator<( const GPSWeekSecond& right ) const
00172 throw();
00173 bool operator>( const GPSWeekSecond& right ) const
00174 throw();
00175 bool operator<=( const GPSWeekSecond& right ) const
00176 throw();
00177 bool operator>=( const GPSWeekSecond& right ) const
00178 throw();
00180
00181 double sow;
00182 };
00183
00184 }
00185
00186 #endif // GPSTK_GPSWEEKSECOND_HPP