00001 #pragma ident "$Id: ANSITime.hpp 1162 2008-03-27 21:18:13Z snelsen $"
00002
00003
00004
00005 #ifndef GPSTK_ANSITIME_HPP
00006 #define GPSTK_ANSITIME_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 #include <time.h>
00032
00033 namespace gpstk
00034 {
00039 class ANSITime : public TimeTag
00040 {
00041 public:
00047
00052 ANSITime( time_t t = 0 )
00053 throw()
00054 {
00055 time = t;
00056 }
00057
00062 ANSITime( const ANSITime& right )
00063 throw()
00064 : time( right.time )
00065 {}
00066
00074 ANSITime( const TimeTag& right )
00075 throw( gpstk::InvalidRequest )
00076 {
00077 convertFromCommonTime( right.convertToCommonTime() );
00078 }
00079
00087 ANSITime( const CommonTime& right )
00088 throw( InvalidRequest )
00089 {
00090 convertFromCommonTime( right );
00091 }
00092
00098 ANSITime& operator=( const ANSITime& right )
00099 throw();
00100
00102 virtual ~ANSITime()
00103 throw()
00104 {}
00106
00107
00108 virtual CommonTime convertToCommonTime() const
00109 throw(InvalidRequest);
00110
00111 virtual void convertFromCommonTime( const CommonTime& ct )
00112 throw(InvalidRequest);
00113
00116 virtual std::string printf( const std::string& fmt ) const
00117 throw( gpstk::StringUtils::StringException );
00118
00121 virtual std::string printError( const std::string& fmt ) const
00122 throw( gpstk::StringUtils::StringException );
00123
00130 virtual bool setFromInfo( const IdToValue& info )
00131 throw();
00132
00135 virtual std::string getPrintChars() const
00136 throw()
00137 {
00138 return "K";
00139 }
00140
00142 virtual std::string getDefaultFormat() const
00143 throw()
00144 {
00145 return "%K";
00146 }
00147
00148 virtual bool isValid() const
00149 throw();
00150
00151 virtual void reset()
00152 throw();
00153
00162 bool operator==( const ANSITime& right ) const
00163 throw();
00164 bool operator!=( const ANSITime& right ) const
00165 throw();
00166 bool operator<( const ANSITime& right ) const
00167 throw();
00168 bool operator>( const ANSITime& right ) const
00169 throw();
00170 bool operator<=( const ANSITime& right ) const
00171 throw();
00172 bool operator>=( const ANSITime& right ) const
00173 throw();
00175
00176 time_t time;
00177 };
00178
00179 }
00180
00181 #endif