GPSZcount.hpp
Go to the documentation of this file.
1 //==============================================================================
2 //
3 // This file is part of GNSSTk, the ARL:UT GNSS Toolkit.
4 //
5 // The GNSSTk is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published
7 // by the Free Software Foundation; either version 3.0 of the License, or
8 // any later version.
9 //
10 // The GNSSTk is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with GNSSTk; if not, write to the Free Software Foundation,
17 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18 //
19 // This software was developed by Applied Research Laboratories at the
20 // University of Texas at Austin.
21 // Copyright 2004-2022, The Board of Regents of The University of Texas System
22 //
23 //==============================================================================
24 
25 //==============================================================================
26 //
27 // This software was developed by Applied Research Laboratories at the
28 // University of Texas at Austin, under contract to an agency or agencies
29 // within the U.S. Department of Defense. The U.S. Government retains all
30 // rights to use, duplicate, distribute, disclose, or release this software.
31 //
32 // Pursuant to DoD Directive 523024
33 //
34 // DISTRIBUTION STATEMENT A: This software has been approved for public
35 // release, distribution is unlimited.
36 //
37 //==============================================================================
38 
44 #ifndef GNSSTK_GPSZCOUNT_HPP
45 #define GNSSTK_GPSZCOUNT_HPP
46 
47 // system includes
48 #include <ostream>
49 
50 // GNSSTK includes
51 #include "gnsstk_export.h"
52 #include "Exception.hpp"
53 
54 namespace gnsstk
55 {
57 
58 
75  class GPSZcount
76  {
77  public:
79  GNSSTK_EXPORT static const long ZCOUNT_MINUTE;
81  GNSSTK_EXPORT static const long ZCOUNT_HOUR;
83  GNSSTK_EXPORT static const long ZCOUNT_DAY;
85  GNSSTK_EXPORT static const long ZCOUNT_WEEK;
86 
93  GPSZcount(short inWeek,
94  long inZcount);
95 
102  GPSZcount(long inFullZcount = 0);
103 
106 
110  GPSZcount(const GPSZcount& right);
111 
113  short getWeek() const
114  { return week ; }
115 
117  long getZcount() const
118  { return zcount ; }
119 
125  long getFullZcount() const
126  { return (long(getWeek() & 0x3FF) << 19) + getZcount() ; }
127 
131  double getTotalZcounts() const
132  { return double(getWeek()) * ZCOUNT_WEEK + getZcount() ; }
133 
140  GPSZcount& setWeek(short inWeek);
141 
148  GPSZcount& setZcount(long inZcount);
149 
156  GPSZcount& setFullZcount(long inZcount);
157 
164  GPSZcount& addWeeks(short inWeeks);
165 
175  GPSZcount& addZcounts(long inZcounts);
176 
184  GPSZcount operator++(int);
185 
193 
201  GPSZcount operator--(int);
202 
210 
220  GPSZcount operator+(long inZcounts) const;
221 
231  GPSZcount operator-(long inZcounts) const;
232 
239  double operator-(const GPSZcount& right) const;
240 
245  long operator%(const long right) const;
246 
256  GPSZcount& operator+=(long inZcounts);
257 
267  GPSZcount& operator-=(long inZcounts);
268 
270  GPSZcount& operator=(const GPSZcount& right);
271 
273  bool operator<(const GPSZcount& right) const;
275  bool operator>(const GPSZcount& right) const;
277  bool operator==(const GPSZcount& right) const;
279  bool operator!=(const GPSZcount& right) const;
281  bool operator<=(const GPSZcount& right) const;
283  bool operator>=(const GPSZcount& right) const;
284 
286  operator std::string() const;
287 
308  bool inSameTimeBlock(const GPSZcount& other,
309  unsigned long inZcountBlock,
310  unsigned long inZcountOffset = 0);
311 
316  void dump(std::ostream& out,
317  short level = 0) const;
318 
319  protected:
320  short week;
321  long zcount;
322 
328  static long validZcount(long z);
329 
330  };
331 
337  std::ostream& operator<<(std::ostream& s,
338  const gnsstk::GPSZcount& z);
339 
341 
342 } // namespace gnsstk
343 
344 #endif // GNSSTK_GPSZCOUNT_HPP
gnsstk::GPSZcount::zcount
long zcount
GPS Z-count. (0 <= zcount <= 403199)
Definition: GPSZcount.hpp:321
gnsstk::GPSZcount::operator+=
GPSZcount & operator+=(long inZcounts)
Definition: GPSZcount.cpp:249
gnsstk::GPSZcount::addZcounts
GPSZcount & addZcounts(long inZcounts)
Definition: GPSZcount.cpp:153
gnsstk::GPSZcount::setZcount
GPSZcount & setZcount(long inZcount)
Definition: GPSZcount.cpp:102
gnsstk::GPSZcount::inSameTimeBlock
bool inSameTimeBlock(const GPSZcount &other, unsigned long inZcountBlock, unsigned long inZcountOffset=0)
Definition: GPSZcount.cpp:324
gnsstk::GPSZcount::getZcount
long getZcount() const
GPS Z-count accessor.
Definition: GPSZcount.hpp:117
gnsstk::GPSZcount::operator<
bool operator<(const GPSZcount &right) const
Comparison operator (less-than).
Definition: GPSZcount.cpp:266
gnsstk::GPSZcount::ZCOUNT_HOUR
static const GNSSTK_EXPORT long ZCOUNT_HOUR
Z-counts per hour (2400)
Definition: GPSZcount.hpp:81
gnsstk::GPSZcount::validZcount
static long validZcount(long z)
Definition: GPSZcount.cpp:368
gnsstk::GPSZcount::setFullZcount
GPSZcount & setFullZcount(long inZcount)
Definition: GPSZcount.cpp:114
gnsstk::GPSZcount::operator>=
bool operator>=(const GPSZcount &right) const
Comparison operator (greater-than or equal-to).
Definition: GPSZcount.cpp:314
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::GPSZcount::ZCOUNT_WEEK
static const GNSSTK_EXPORT long ZCOUNT_WEEK
Z-counts per whole GPS week. (403200)
Definition: GPSZcount.hpp:85
gnsstk::GPSZcount::~GPSZcount
~GPSZcount()
Destructor. Does nothing.
Definition: GPSZcount.hpp:105
gnsstk::GPSZcount::operator-=
GPSZcount & operator-=(long inZcounts)
Definition: GPSZcount.cpp:254
gnsstk::GPSZcount::operator-
GPSZcount operator-(long inZcounts) const
Definition: GPSZcount.cpp:233
gnsstk::GPSZcount::operator=
GPSZcount & operator=(const GPSZcount &right)
Assignment operator.
Definition: GPSZcount.cpp:259
gnsstk::GPSZcount::operator%
long operator%(const long right) const
Definition: GPSZcount.cpp:244
gnsstk::GPSZcount::GPSZcount
GPSZcount(short inWeek, long inZcount)
Definition: GPSZcount.cpp:59
gnsstk::GPSZcount
Definition: GPSZcount.hpp:75
gnsstk::GPSZcount::getWeek
short getWeek() const
GPS week accessor.
Definition: GPSZcount.hpp:113
gnsstk::GPSZcount::week
short week
GPS full week. (0 <= week)
Definition: GPSZcount.hpp:320
gnsstk::GPSZcount::getFullZcount
long getFullZcount() const
Definition: GPSZcount.hpp:125
gnsstk::operator<<
std::ostream & operator<<(std::ostream &s, const ObsEpoch &oe) noexcept
Definition: ObsEpochMap.cpp:54
gnsstk::GPSZcount::setWeek
GPSZcount & setWeek(short inWeek)
Definition: GPSZcount.cpp:90
gnsstk::GPSZcount::operator--
GPSZcount & operator--()
Definition: GPSZcount.cpp:223
gnsstk::GPSZcount::operator<=
bool operator<=(const GPSZcount &right) const
Comparison operator (less-than or equal-to).
Definition: GPSZcount.cpp:309
gnsstk::GPSZcount::getTotalZcounts
double getTotalZcounts() const
Definition: GPSZcount.hpp:131
Exception.hpp
gnsstk::GPSZcount::ZCOUNT_MINUTE
static const GNSSTK_EXPORT long ZCOUNT_MINUTE
Z-counts per minute (40)
Definition: GPSZcount.hpp:79
gnsstk::GPSZcount::addWeeks
GPSZcount & addWeeks(short inWeeks)
Definition: GPSZcount.cpp:133
gnsstk::GPSZcount::operator>
bool operator>(const GPSZcount &right) const
Comparison operator (greater-than).
Definition: GPSZcount.cpp:280
gnsstk::GPSZcount::ZCOUNT_DAY
static const GNSSTK_EXPORT long ZCOUNT_DAY
Z-counts per day (57600)
Definition: GPSZcount.hpp:83
gnsstk::GPSZcount::dump
void dump(std::ostream &out, short level=0) const
Definition: GPSZcount.cpp:352
gnsstk::GPSZcount::operator++
GPSZcount & operator++()
Definition: GPSZcount.cpp:211
gnsstk::GPSZcount::operator+
GPSZcount operator+(long inZcounts) const
Definition: GPSZcount.cpp:228
gnsstk::GPSZcount::operator==
bool operator==(const GPSZcount &right) const
Equality operator.
Definition: GPSZcount.cpp:294
gnsstk::GPSZcount::operator!=
bool operator!=(const GPSZcount &right) const
Inequality operator.
Definition: GPSZcount.cpp:304


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:39