ANSITime.hpp

Go to the documentation of this file.
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 //  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 #include <time.h>     // for time_t
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          // The following functions are required by TimeTag.
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 } // namespace
00180 
00181 #endif // GPSTK_ANSITIME_HPP

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