GPSWeekSecond.hpp

Go to the documentation of this file.
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 //  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 "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          // The following functions are required by TimeTag.
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

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