A representation class for GPS Time consisting of a short GPS week, and a long GPS Z-count. A valid GPS week is in the following range: 0 <= week <= numerical_limits<short>::max() A valid GPS Z-count is in the following range: 0 <= zcount < 403200
In Z-count addition, if a specified Z-count value is above or below the given range of valid Z-counts, the appropriate number of GPS weeks-worth of Z-counts are added or subtracted from the given value so that it falls within the acceptable range. These extra weeks are then accounted for in the weeks data member. If the addition or subtraction of these additional weeks cause the GPS week value to go out-of-bounds, an InvalidRequest exception is thrown.
Definition at line 75 of file GPSZcount.hpp.
#include <GPSZcount.hpp>
Public Member Functions | |
GPSZcount & | addWeeks (short inWeeks) |
GPSZcount & | addZcounts (long inZcounts) |
void | dump (std::ostream &out, short level=0) const |
long | getFullZcount () const |
double | getTotalZcounts () const |
short | getWeek () const |
GPS week accessor. More... | |
long | getZcount () const |
GPS Z-count accessor. More... | |
GPSZcount (const GPSZcount &right) | |
GPSZcount (long inFullZcount=0) | |
GPSZcount (short inWeek, long inZcount) | |
bool | inSameTimeBlock (const GPSZcount &other, unsigned long inZcountBlock, unsigned long inZcountOffset=0) |
operator std::string () const | |
Convert this object to a string. More... | |
bool | operator!= (const GPSZcount &right) const |
Inequality operator. More... | |
long | operator% (const long right) const |
GPSZcount | operator+ (long inZcounts) const |
GPSZcount & | operator++ () |
GPSZcount | operator++ (int) |
GPSZcount & | operator+= (long inZcounts) |
double | operator- (const GPSZcount &right) const |
GPSZcount | operator- (long inZcounts) const |
GPSZcount & | operator-- () |
GPSZcount | operator-- (int) |
GPSZcount & | operator-= (long inZcounts) |
bool | operator< (const GPSZcount &right) const |
Comparison operator (less-than). More... | |
bool | operator<= (const GPSZcount &right) const |
Comparison operator (less-than or equal-to). More... | |
GPSZcount & | operator= (const GPSZcount &right) |
Assignment operator. More... | |
bool | operator== (const GPSZcount &right) const |
Equality operator. More... | |
bool | operator> (const GPSZcount &right) const |
Comparison operator (greater-than). More... | |
bool | operator>= (const GPSZcount &right) const |
Comparison operator (greater-than or equal-to). More... | |
GPSZcount & | setFullZcount (long inZcount) |
GPSZcount & | setWeek (short inWeek) |
GPSZcount & | setZcount (long inZcount) |
~GPSZcount () | |
Destructor. Does nothing. More... | |
Static Public Attributes | |
static const GNSSTK_EXPORT long | ZCOUNT_DAY = 57600 |
Z-counts per day (57600) More... | |
static const GNSSTK_EXPORT long | ZCOUNT_HOUR = 2400 |
Z-counts per hour (2400) More... | |
static const GNSSTK_EXPORT long | ZCOUNT_MINUTE = 40 |
Z-counts per minute (40) More... | |
static const GNSSTK_EXPORT long | ZCOUNT_WEEK = 403200 |
Z-counts per whole GPS week. (403200) More... | |
Static Protected Member Functions | |
static long | validZcount (long z) |
Protected Attributes | |
short | week |
GPS full week. (0 <= week) More... | |
long | zcount |
GPS Z-count. (0 <= zcount <= 403199) More... | |
gnsstk::GPSZcount::GPSZcount | ( | short | inWeek, |
long | inZcount | ||
) |
Separate Week and Z-count Constructor.
inWeek | the GPS week to use in this object. |
inZcount | the GPS Z-count to use in this object. |
gnsstk::InvalidParameter | if either inWeek or inZcount are invalid values for their respective types. |
Definition at line 59 of file GPSZcount.cpp.
gnsstk::GPSZcount::GPSZcount | ( | long | inFullZcount = 0 | ) |
Full Z-count Constructor.
inFullZcount | the Full 29-bit GPS Z-count to use in this object. (default=0 => week == 0; Z-count == 0) |
gnsstk::InvalidParameter | if either inFullZcount is an invalid value for a full Z-count. |
Definition at line 73 of file GPSZcount.cpp.
|
inline |
Destructor. Does nothing.
Definition at line 105 of file GPSZcount.hpp.
Copy Constructor.
right | the GPSZcount object to copy |
Definition at line 85 of file GPSZcount.cpp.
GPSZcount & gnsstk::GPSZcount::addWeeks | ( | short | inWeeks | ) |
Add the given number of weeks to the current value.
inWeeks | the number of weeks to add to the current value. |
gnsstk::InvalidRequest | if adding inWeeks would render this object invalid. |
Definition at line 133 of file GPSZcount.cpp.
GPSZcount & gnsstk::GPSZcount::addZcounts | ( | long | inZcounts | ) |
Add the given number of Z-counts to the current value. This may cause a roll-(over/under) of the Z-count and appropriate modification of the week.
inZcounts | the number of Z-counts to add to the current value. |
gnsstk::InvalidRequest | if adding inZcounts would render this object invalid. |
Definition at line 153 of file GPSZcount.cpp.
void gnsstk::GPSZcount::dump | ( | std::ostream & | out, |
short | level = 0 |
||
) | const |
Dump the contents of this object to the given output stream.
out | the output stream to write to |
level | the level of verbosity to use (default=0) |
Definition at line 352 of file GPSZcount.cpp.
|
inline |
Construct, from the data members, the Z-count which could have been broadcast from an SV.
Definition at line 125 of file GPSZcount.hpp.
|
inline |
Calculate the total number of Z-counts in this object.
Definition at line 131 of file GPSZcount.hpp.
|
inline |
GPS week accessor.
Definition at line 113 of file GPSZcount.hpp.
|
inline |
GPS Z-count accessor.
Definition at line 117 of file GPSZcount.hpp.
bool gnsstk::GPSZcount::inSameTimeBlock | ( | const GPSZcount & | other, |
unsigned long | inZcountBlock, | ||
unsigned long | inZcountOffset = 0 |
||
) |
This is a test of whether or not this object and the given GPSZcount object are within the same time-block. Say you need to find out if the two GPSZcounts are: ... in the same day: inZcountBlock == ZCOUNT_DAY ... or the same minute: inZcountBlock == ZCOUNT_MINUTE etc. For inZcountBlock < ZCOUNT_WEEK, blocks start at the beginning of the week. For inZcountBlock >= ZCOUNT_WEEK, blocks start at the beginning of GPS Week 0. inZcountOffset allows checking of times off of the usual boundaries i.e. in the same day where a day is defined as starting at noon instead of at midnight, or in the same minute where a minute starts at 23 seconds instead of zero.
other | the other GPSZcount object |
inZcountBlock | the number of Z-counts in a time-block |
inZcountOffset | the number of Z-counts to offset the time-block (default = 0) |
Definition at line 324 of file GPSZcount.cpp.
gnsstk::GPSZcount::operator std::string | ( | ) | const |
Convert this object to a string.
Definition at line 319 of file GPSZcount.cpp.
Inequality operator.
Definition at line 304 of file GPSZcount.cpp.
long gnsstk::GPSZcount::operator% | ( | const long | right | ) | const |
Compute the remainder of the ztime
right | the number to |
Definition at line 244 of file GPSZcount.cpp.
GPSZcount gnsstk::GPSZcount::operator+ | ( | long | inZcounts | ) | const |
Add the given number of Z-counts to the current value. This may cause a roll-(over/under) of the Z-count and appropriate modification of the week.
inZcounts | the number of Z-counts to add to the current value. |
gnsstk::InvalidRequest | if adding inZcounts would render this object invalid. |
Definition at line 228 of file GPSZcount.cpp.
GPSZcount & gnsstk::GPSZcount::operator++ | ( | ) |
Prefix Increment the Z-count in this object (++x). This may also cause the roll-over of the Z-count and incrementing of the week.
gnsstk::InvalidRequest | if Z-count increment would render this object invalid. |
Definition at line 211 of file GPSZcount.cpp.
GPSZcount gnsstk::GPSZcount::operator++ | ( | int | ) |
Postfix Increment the Z-count in this object (x++). This may also cause the roll-over of the Z-count and incrementing of the week.
gnsstk::InvalidRequest | if Z-count increment would render this object invalid. |
Definition at line 204 of file GPSZcount.cpp.
GPSZcount & gnsstk::GPSZcount::operator+= | ( | long | inZcounts | ) |
Add the given number of Z-counts to the current value. This may cause a roll-(over/under) of the Z-count and appropriate modification of the week.
inZcounts | the number of Z-counts to add to the current value. |
gnsstk::InvalidRequest | if adding inZcounts would render this object invalid. |
Definition at line 249 of file GPSZcount.cpp.
Compute the time differenct between this object and right.
right | the GPSZcount to subtract from this object |
Definition at line 238 of file GPSZcount.cpp.
GPSZcount gnsstk::GPSZcount::operator- | ( | long | inZcounts | ) | const |
Subtract the given number of Z-counts from the current value. This may cause a roll-(over/under) of the Z-count and appropriate modification of the week.
inZcounts | the number of Z-counts to subtract from the current value. |
gnsstk::InvalidRequest | if subtracting inZcounts would render this object invalid. |
Definition at line 233 of file GPSZcount.cpp.
GPSZcount & gnsstk::GPSZcount::operator-- | ( | ) |
Prefix Decrement the Z-count in this object (–x). This may also cause the roll-under of the Z-count and decrementing of the week.
gnsstk::InvalidRequest | if a Z-count decrement would render this object invalid. |
Definition at line 223 of file GPSZcount.cpp.
GPSZcount gnsstk::GPSZcount::operator-- | ( | int | ) |
Postfix Decrement the Z-count in this object (x–). This may also cause the roll-under of the Z-count and decrementing of the week.
gnsstk::InvalidRequest | if a Z-count decrement would render this object invalid. |
Definition at line 216 of file GPSZcount.cpp.
GPSZcount & gnsstk::GPSZcount::operator-= | ( | long | inZcounts | ) |
Subtract the given number of Z-counts from the current value. This may cause a roll-(over/under) of the Z-count and appropriate modification of the week.
inZcounts | the number of Z-counts to subtract from the current value. |
gnsstk::InvalidRequest | if subtracting inZcounts would render this object invalid. |
Definition at line 254 of file GPSZcount.cpp.
Comparison operator (less-than).
Definition at line 266 of file GPSZcount.cpp.
Comparison operator (less-than or equal-to).
Definition at line 309 of file GPSZcount.cpp.
Assignment operator.
Definition at line 259 of file GPSZcount.cpp.
Equality operator.
Definition at line 294 of file GPSZcount.cpp.
Comparison operator (greater-than).
Definition at line 280 of file GPSZcount.cpp.
Comparison operator (greater-than or equal-to).
Definition at line 314 of file GPSZcount.cpp.
GPSZcount & gnsstk::GPSZcount::setFullZcount | ( | long | inZcount | ) |
Set the GPS Week and Z-count using the value broadcast from an SV.
inZcount | A full Z-count (3 MSB unused, next 10 bits = week, 19 LSB = Z-count) |
gnsstk::InvalidParameter | if the extracted Z-count is an invalid value for a GPS Z-count. |
Definition at line 114 of file GPSZcount.cpp.
GPSZcount & gnsstk::GPSZcount::setWeek | ( | short | inWeek | ) |
Set the GPS week.
inWeek | the new value for GPS Week. |
gnsstk::InvalidParameter | if inWeek is an invalid value for a GPS week. |
Definition at line 90 of file GPSZcount.cpp.
GPSZcount & gnsstk::GPSZcount::setZcount | ( | long | inZcount | ) |
Set the GPS Z-count.
inZcount | the new value for GPS Z-count. |
gnsstk::InvalidParameter | if inZcount is an invalid value for a GPS Z-count. |
Definition at line 102 of file GPSZcount.cpp.
|
staticprotected |
Check the validity of the given Z-count.
z | the Z-count to verify |
Definition at line 368 of file GPSZcount.cpp.
|
protected |
GPS full week. (0 <= week)
Definition at line 320 of file GPSZcount.hpp.
|
protected |
GPS Z-count. (0 <= zcount <= 403199)
Definition at line 321 of file GPSZcount.hpp.
|
static |
Z-counts per day (57600)
Definition at line 83 of file GPSZcount.hpp.
|
static |
Z-counts per hour (2400)
Definition at line 81 of file GPSZcount.hpp.
|
static |
Z-counts per minute (40)
Definition at line 79 of file GPSZcount.hpp.
|
static |
Z-counts per whole GPS week. (403200)
Definition at line 85 of file GPSZcount.hpp.