YDSTime.hpp

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

Generated on Tue May 22 03:31:02 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1