GPSZcount.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: GPSZcount.hpp 500 2007-04-27 12:02:53Z ocibu $"
00002 
00003 
00004 
00010 #ifndef GPSTK_GPSZCOUNT_HPP
00011 #define GPSTK_GPSZCOUNT_HPP
00012 
00013 //============================================================================
00014 //
00015 //  This file is part of GPSTk, the GPS Toolkit.
00016 //
00017 //  The GPSTk is free software; you can redistribute it and/or modify
00018 //  it under the terms of the GNU Lesser General Public License as published
00019 //  by the Free Software Foundation; either version 2.1 of the License, or
00020 //  any later version.
00021 //
00022 //  The GPSTk is distributed in the hope that it will be useful,
00023 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00024 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00025 //  GNU Lesser General Public License for more details.
00026 //
00027 //  You should have received a copy of the GNU Lesser General Public
00028 //  License along with GPSTk; if not, write to the Free Software Foundation,
00029 //  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00030 //  
00031 //  Copyright 2004, The University of Texas at Austin
00032 //
00033 //============================================================================
00034 
00035 //============================================================================
00036 //
00037 //This software developed by Applied Research Laboratories at the University of
00038 //Texas at Austin, under contract to an agency or agencies within the U.S. 
00039 //Department of Defense. The U.S. Government retains all rights to use,
00040 //duplicate, distribute, disclose, or release this software. 
00041 //
00042 //Pursuant to DoD Directive 523024 
00043 //
00044 // DISTRIBUTION STATEMENT A: This software has been approved for public 
00045 //                           release, distribution is unlimited.
00046 //
00047 //=============================================================================
00048 
00049 // system includes
00050 #include <ostream>
00051 
00052 // GPSTK includes
00053 #include "Exception.hpp"
00054 
00055 namespace gpstk
00056 {
00059 
00076    class GPSZcount
00077    {
00078    public:
00080       static const long ZCOUNT_MINUTE;
00082       static const long ZCOUNT_HOUR;
00084       static const long ZCOUNT_DAY;
00086       static const long ZCOUNT_WEEK;
00087 
00094       GPSZcount(short inWeek,
00095                 long inZcount)
00096          throw(gpstk::InvalidParameter) ;
00097       
00104       GPSZcount(long inFullZcount = 0) 
00105          throw(gpstk::InvalidParameter) ;
00106       
00108       ~GPSZcount() throw() {}
00109       
00113       GPSZcount(const GPSZcount& right)
00114          throw() ;
00115       
00117       short getWeek() const throw()
00118       { return week ; }
00119       
00121       long getZcount() const throw()
00122       { return zcount ; }
00123       
00129       long getFullZcount() const
00130          throw() 
00131       { return (long(getWeek() & 0x3FF) << 19) + getZcount() ; }
00132 
00136       double getTotalZcounts() const
00137          throw()
00138       { return double(getWeek()) * ZCOUNT_WEEK + getZcount() ; }
00139 
00146       GPSZcount& setWeek(short inWeek) 
00147          throw(gpstk::InvalidParameter) ;
00148       
00155       GPSZcount& setZcount(long inZcount)
00156          throw(gpstk::InvalidParameter) ;
00157 
00164       GPSZcount& setFullZcount(long inZcount)
00165          throw(gpstk::InvalidParameter) ;
00166       
00173       GPSZcount& addWeeks(short inWeeks)
00174          throw(gpstk::InvalidRequest) ;
00175       
00185       GPSZcount& addZcounts(long inZcounts)
00186          throw(gpstk::InvalidRequest) ;
00187 
00195       GPSZcount operator++(int)
00196          throw(gpstk::InvalidRequest) ;
00197 
00204       GPSZcount& operator++() 
00205          throw(gpstk::InvalidRequest) ;
00206       
00214       GPSZcount operator--(int) 
00215          throw(gpstk::InvalidRequest) ;
00216 
00223       GPSZcount& operator--() 
00224          throw(gpstk::InvalidRequest) ;
00225       
00235       GPSZcount operator+(long inZcounts) const
00236          throw(gpstk::InvalidRequest) ;
00237       
00247       GPSZcount operator-(long inZcounts) const
00248          throw(gpstk::InvalidRequest) ;
00249 
00256       double operator-(const GPSZcount& right) const
00257          throw() ;
00258       
00263       long operator%(const long right) const
00264          throw() ;
00265 
00275       GPSZcount& operator+=(long inZcounts)
00276          throw(gpstk::InvalidRequest) ;
00277       
00287       GPSZcount& operator-=(long inZcounts)
00288          throw(gpstk::InvalidRequest) ;
00289       
00291       GPSZcount& operator=(const GPSZcount& right) 
00292          throw();
00293       
00295       bool operator<(const GPSZcount& right) const
00296          throw();
00298       bool operator>(const GPSZcount& right) const
00299          throw();
00301       bool operator==(const GPSZcount& right) const
00302          throw();
00304       bool operator!=(const GPSZcount& right) const
00305          throw();
00307       bool operator<=(const GPSZcount& right) const
00308          throw();
00310       bool operator>=(const GPSZcount& right) const
00311          throw();
00312 
00314       operator std::string() const
00315          throw() ;
00316 
00337       bool inSameTimeBlock(const GPSZcount& other,
00338                            unsigned long inZcountBlock,
00339                            unsigned long inZcountOffset = 0) 
00340          throw();
00341 
00346       void dump(std::ostream& out,
00347                 short level = 0) const
00348          throw() ;
00349       
00350    protected:
00351       short week;    
00352       long zcount;   
00353 
00359       static long validZcount(long z)
00360          throw();
00361       
00362    };
00363    
00369    std::ostream& operator<<(std::ostream& s,
00370                             const gpstk::GPSZcount& z) ;
00371 
00373 
00374 } // namespace gpstk
00375 
00376 #endif // GPSTK_GPSZCOUNT_HPP

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