GPSWeekSecond.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: GPSWeekSecond.hpp 3140 2012-06-18 15:03:02Z susancummins $"
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
00025 //  
00026 //  Copyright 2004, The University of Texas at Austin
00027 //
00028 //============================================================================
00029 
00030 //============================================================================
00031 //
00032 //This software developed by Applied Research Laboratories at the University of
00033 //Texas at Austin, under contract to an agency or agencies within the U.S. 
00034 //Department of Defense. The U.S. Government retains all rights to use,
00035 //duplicate, distribute, disclose, or release this software. 
00036 //
00037 //Pursuant to DoD Directive 523024 
00038 //
00039 // DISTRIBUTION STATEMENT A: This software has been approved for public 
00040 //                           release, distribution is unlimited.
00041 //
00042 //=============================================================================
00043 
00044 #include "GPSWeek.hpp"
00045 #include "TimeConstants.hpp"
00046 #include "TimeSystem.hpp"
00047 
00048 namespace gpstk
00049 {
00054    class GPSWeekSecond : public GPSWeek
00055    {
00056    public:
00066       GPSWeekSecond( unsigned int w = 0,
00067                      double s = 0.,
00068                      TimeSystem ts = TimeSystem::Unknown )
00069          throw()
00070             : GPSWeek(w), sow(s)
00071       { timeSystem = ts; }
00072       
00077       GPSWeekSecond( const GPSWeekSecond& right )
00078          throw()
00079             : GPSWeek( right ), sow( right.sow )
00080       { timeSystem = right.timeSystem; }
00081       
00089       GPSWeekSecond( const TimeTag& right )
00090          throw( gpstk::InvalidRequest )
00091       { 
00092          convertFromCommonTime( right.convertToCommonTime() ); 
00093       }
00094       
00102       GPSWeekSecond( const CommonTime& right )
00103          throw( gpstk::InvalidRequest )
00104       {
00105          convertFromCommonTime( right );
00106       }
00107 
00113       GPSWeekSecond& operator=( const GPSWeekSecond& right )
00114          throw();
00115       
00117       virtual ~GPSWeekSecond()
00118          throw()
00119       {}
00121 
00122          // The following functions are required by TimeTag.
00123       virtual CommonTime convertToCommonTime() const
00124          throw( gpstk::InvalidRequest );
00125 
00126       virtual void convertFromCommonTime( const CommonTime& ct )
00127          throw( gpstk::InvalidRequest );
00128 
00131       virtual std::string printf( const std::string& fmt ) const
00132          throw( gpstk::StringUtils::StringException );
00133 
00136       virtual std::string printError( const std::string& fmt ) const
00137          throw( gpstk::StringUtils::StringException );
00138 
00145       virtual bool setFromInfo( const IdToValue& info )
00146          throw();
00147       
00150       virtual std::string getPrintChars() const
00151          throw()
00152       { 
00153          return GPSWeek::getPrintChars() + "wg";
00154       }
00155 
00157       virtual std::string getDefaultFormat() const
00158          throw()
00159       {
00160          return GPSWeek::getDefaultFormat() + " %010.3g %P";
00161       }
00162 
00163       virtual bool isValid() const
00164          throw();
00165 
00166       virtual void reset()
00167          throw();
00168 
00169       inline virtual unsigned int getDayOfWeek() const
00170          throw()
00171       {
00172          return static_cast<unsigned int>(sow) / SEC_PER_DAY;
00173       }
00174 
00183       bool operator==( const GPSWeekSecond& right ) const
00184          throw();
00185       bool operator!=( const GPSWeekSecond& right ) const
00186          throw();
00187       bool operator<( const GPSWeekSecond& right ) const
00188          throw();
00189       bool operator>( const GPSWeekSecond& right ) const
00190          throw();
00191       bool operator<=( const GPSWeekSecond& right ) const
00192          throw();
00193       bool operator>=( const GPSWeekSecond& right ) const
00194          throw();
00196 
00197       double sow;
00198    };
00199 
00200 }
00201 
00202 #endif // GPSTK_GPSWEEKSECOND_HPP

Generated on Fri May 24 03:31:07 2013 for GPS ToolKit Software Library by  doxygen 1.3.9.1