This class encapsulates the "Full GPS Week and GPS Z-count" time representation.
Definition at line 55 of file GPSWeekZcount.hpp.
#include <GPSWeekZcount.hpp>
Public Member Functions | |
GPSWeekZcount Basic Operations | |
GPSWeekZcount (int w=0, int z=0, TimeSystem ts=TimeSystem::GPS) | |
GPSWeekZcount (const GPSWeekZcount &right) | |
GPSWeekZcount (const TimeTag &right) | |
GPSWeekZcount (const CommonTime &right) | |
GPSWeekZcount & | operator= (const GPSWeekZcount &right) |
virtual | ~GPSWeekZcount () |
Virtual Destructor. More... | |
virtual CommonTime | convertToCommonTime () const |
virtual void | convertFromCommonTime (const CommonTime &ct) |
virtual std::string | printf (const std::string &fmt) const |
virtual std::string | printError (const std::string &fmt) const |
virtual bool | setFromInfo (const IdToValue &info) |
virtual std::string | getPrintChars () const |
virtual std::string | getDefaultFormat () const |
Return a string containing the default format to use in printing. More... | |
virtual bool | isValid () const |
Returns true if this object's members are valid, false otherwise. More... | |
virtual void | reset () |
Reset this object to the default state. More... | |
Special Zcount-related Methods. | |
| |
unsigned int | getZcount29 () const |
unsigned int | getZcount32 () const |
GPSWeekZcount & | setZcount29 (unsigned int z) |
GPSWeekZcount & | setZcount32 (unsigned int z) |
virtual unsigned int | getDayOfWeek () const |
Force this interface on this classes descendants. More... | |
![]() | |
GPSWeek (int w=0, TimeSystem ts=TimeSystem::Unknown) | |
Constructor. More... | |
GPSWeek & | operator= (const GPSWeek &right) |
Assignment Operator. More... | |
virtual | ~GPSWeek () |
Virtual Destructor. More... | |
bool | operator== (const GPSWeek &right) const |
bool | operator!= (const GPSWeek &right) const |
bool | operator< (const GPSWeek &right) const |
bool | operator<= (const GPSWeek &right) const |
bool | operator> (const GPSWeek &right) const |
bool | operator>= (const GPSWeek &right) const |
virtual unsigned int | getEpoch () const |
virtual unsigned int | getWeek10 () const |
virtual void | getEpochWeek10 (unsigned int &e, unsigned int &w) const |
virtual void | setEpoch (unsigned int e) |
virtual void | setWeek10 (unsigned int w) |
virtual void | setEpochWeek10 (unsigned int e, unsigned int w) |
![]() | |
virtual std::string | asString () const |
bool | changeTimeSystem (TimeSystem timeSys) |
bool | changeTimeSystem (TimeSystem timeSys, TimeSystemConverter *conv) |
TimeSystem | getTimeSystem () const |
Obtain time system info (enum). More... | |
virtual | operator CommonTime () const |
virtual void | scanf (const std::string &str, const std::string &fmt) |
void | setTimeSystem (const TimeSystem &timeSys) |
Set method for internal variable timeSystem (enum). More... | |
TimeTag () | |
Default constructor. More... | |
TimeTag (const TimeSystem &ts) | |
Constructor. More... | |
virtual | ~TimeTag () |
Virtual Destructor. More... | |
Static Public Attributes | |
static const unsigned int | bits19 = 0x7FFFF |
This is just a 19-bit mask. More... | |
![]() | |
static const GNSSTK_EXPORT int | bits10 = 0x3FF |
static const GNSSTK_EXPORT int | MAX_WEEK =(CommonTime::END_LIMIT_JDAY-MJD_JDAY-GPS_EPOCH_MJD)/7 |
GPSWeekZcount Comparison Operators | |
All comparison operators have a parameter "right" which corresponds to the GPSWeekZcount object to the right of the symbol. All comparison operators are const and return true on success and false on failure. | |
unsigned int | zcount |
bool | operator== (const GPSWeekZcount &right) const |
bool | operator!= (const GPSWeekZcount &right) const |
bool | operator< (const GPSWeekZcount &right) const |
bool | operator> (const GPSWeekZcount &right) const |
bool | operator<= (const GPSWeekZcount &right) const |
bool | operator>= (const GPSWeekZcount &right) const |
unsigned long | getTotalZcounts () const noexcept |
GPSWeekZcount & | addWeeks (short inWeeks) |
GPSWeekZcount & | addZcounts (long inZcounts) |
GPSWeekZcount | operator++ (int) |
GPSWeekZcount & | operator++ () |
GPSWeekZcount | operator-- (int) |
GPSWeekZcount & | operator-- () |
GPSWeekZcount | operator+ (long inZcounts) const |
GPSWeekZcount | operator- (long inZcounts) const |
long | operator- (const GPSWeekZcount &right) const noexcept |
GPSWeekZcount & | operator+= (long inZcounts) |
GPSWeekZcount & | operator-= (long inZcounts) |
bool | inSameTimeBlock (const GPSWeekZcount &other, unsigned long inZcountBlock, unsigned long inZcountOffset=0) noexcept |
Additional Inherited Members | |
![]() | |
typedef std::map< char, std::string > | IdToValue |
![]() | |
static void | checkTimeSystem (TimeSystem ts1, TimeSystem ts2) |
static std::string | getError () |
This returns the default error string for the TimeTag classes. More... | |
static std::string | getFormatPrefixFloat () |
static std::string | getFormatPrefixInt () |
static void | getInfo (const std::string &str, const std::string &fmt, IdToValue &info) |
![]() | |
int | week |
![]() | |
TimeSystem | timeSystem |
time system (representation) of the data More... | |
|
inline |
Default Constructor. All elements are initialized to zero.
Definition at line 69 of file GPSWeekZcount.hpp.
|
inline |
Copy Constructor.
right | a reference to the GPSWeekZcount object to copy |
Definition at line 79 of file GPSWeekZcount.hpp.
Alternate Copy Constructor. Takes a const TimeTag reference and copies its contents via conversion to CommonTime.
right | a const reference to the BasicTime object to copy |
InvalidRequest | on over-/under-flow |
Definition at line 90 of file GPSWeekZcount.hpp.
|
inline |
Alternate Copy Constructor. Takes a const CommonTime reference and copies its contents via the convertFromCommonTime method.
right | a const reference to the CommonTime object to copy |
InvalidRequest | on over-/under-flow |
Definition at line 102 of file GPSWeekZcount.hpp.
|
inlinevirtual |
Virtual Destructor.
Definition at line 115 of file GPSWeekZcount.hpp.
GPSWeekZcount & gnsstk::GPSWeekZcount::addWeeks | ( | short | inWeeks | ) |
Add the given number of weeks to the current value.
[in] | inWeeks | the number of weeks to add to the current value. |
gnsstk::InvalidRequest | if adding inWeeks would render this object invalid. |
Definition at line 245 of file GPSWeekZcount.cpp.
GPSWeekZcount & gnsstk::GPSWeekZcount::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.
[in] | 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 257 of file GPSWeekZcount.cpp.
|
virtual |
InvalidRequest | if ct cannot be correctly represented in this TimeTag object. |
This is the earliest CommonTime representable by GPSWeekZcount.
Implements gnsstk::TimeTag.
Definition at line 88 of file GPSWeekZcount.cpp.
|
virtual |
InvalidRequest | if this TimeTag cannot be correctly represented by a CommonTime object. |
Implements gnsstk::TimeTag.
Definition at line 68 of file GPSWeekZcount.cpp.
|
inlinevirtual |
Force this interface on this classes descendants.
Implements gnsstk::GPSWeek.
Definition at line 183 of file GPSWeekZcount.hpp.
|
inlinevirtual |
Return a string containing the default format to use in printing.
Reimplemented from gnsstk::GPSWeek.
Definition at line 148 of file GPSWeekZcount.hpp.
|
inlinevirtual |
Return a string containing the characters that this class understands when printing times.
Reimplemented from gnsstk::GPSWeek.
Definition at line 142 of file GPSWeekZcount.hpp.
|
inlinenoexcept |
Calculate the total number of Z-counts in this object.
Definition at line 244 of file GPSWeekZcount.hpp.
|
inline |
Definition at line 168 of file GPSWeekZcount.hpp.
|
inline |
Definition at line 173 of file GPSWeekZcount.hpp.
|
noexcept |
This is a test of whether or not this object and the given GPSWeekZcount object are within the same time-block. Say you need to find out if the two GPSWeekZcounts are: ... in the same day: inZcountBlock == ZCOUNT_PER_DAY ... or the same minute: inZcountBlock == ZCOUNT_PER_MINUTE etc. For inZcountBlock < ZCOUNT_WEEK, block 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 midnight, or in the same minute where a minute starts at 23 seconds instead of zero.
[in] | other | The other GPSWeekZcount object. |
[in] | inZcountBlock | The number of Z-counts in a time-block. |
[in] | inZcountOffset | The number of Z-counts to offset the time-block (default = 0). |
Definition at line 367 of file GPSWeekZcount.cpp.
|
inlinevirtual |
Returns true if this object's members are valid, false otherwise.
Reimplemented from gnsstk::GPSWeek.
Definition at line 153 of file GPSWeekZcount.hpp.
|
inline |
Definition at line 202 of file GPSWeekZcount.hpp.
GPSWeekZcount gnsstk::GPSWeekZcount::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.
[in] | 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 335 of file GPSWeekZcount.cpp.
GPSWeekZcount & gnsstk::GPSWeekZcount::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 adding inZcounts would render this object invalid. |
Definition at line 315 of file GPSWeekZcount.cpp.
GPSWeekZcount gnsstk::GPSWeekZcount::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 adding inZcounts would render this object invalid. |
Definition at line 307 of file GPSWeekZcount.cpp.
GPSWeekZcount & gnsstk::GPSWeekZcount::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.
[in] | 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 355 of file GPSWeekZcount.cpp.
|
noexcept |
Compute the time difference between this object and right.
[in] | right | the GPSWeekZcount to subtract from this object. |
Definition at line 347 of file GPSWeekZcount.cpp.
GPSWeekZcount gnsstk::GPSWeekZcount::operator- | ( | long | inZcounts | ) | const |
Subtract 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.
[in] | inZcounts | the number of Z-counts to subtract from the current value. |
gnsstk::InvalidRequest | if adding inZcounts would render this object invalid. |
Definition at line 341 of file GPSWeekZcount.cpp.
GPSWeekZcount & gnsstk::GPSWeekZcount::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 329 of file GPSWeekZcount.cpp.
GPSWeekZcount gnsstk::GPSWeekZcount::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 321 of file GPSWeekZcount.cpp.
GPSWeekZcount & gnsstk::GPSWeekZcount::operator-= | ( | long | inZcounts | ) |
Subtract 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.
[in] | inZcounts | the number of Z-counts to subtract from the current value. |
gnsstk::InvalidRequest | if adding inZcounts would render this object invalid. |
Definition at line 361 of file GPSWeekZcount.cpp.
|
inline |
Definition at line 207 of file GPSWeekZcount.hpp.
|
inline |
Definition at line 229 of file GPSWeekZcount.hpp.
GPSWeekZcount & gnsstk::GPSWeekZcount::operator= | ( | const GPSWeekZcount & | right | ) |
Assignment Operator.
right | a const reference to the GPSWeekZcount to copy |
Definition at line 61 of file GPSWeekZcount.cpp.
|
inline |
Definition at line 197 of file GPSWeekZcount.hpp.
|
inline |
Definition at line 224 of file GPSWeekZcount.hpp.
|
inline |
Definition at line 234 of file GPSWeekZcount.hpp.
|
virtual |
This function works similarly to printf. Instead of filling the format with data, it fills with error messages.
Reimplemented from gnsstk::GPSWeek.
Definition at line 146 of file GPSWeekZcount.cpp.
|
virtual |
This function formats this time to a string. The exceptions thrown would only be due to problems parsing the fmt string.
Reimplemented from gnsstk::GPSWeek.
Definition at line 114 of file GPSWeekZcount.cpp.
|
inlinevirtual |
Reset this object to the default state.
Reimplemented from gnsstk::GPSWeek.
Definition at line 158 of file GPSWeekZcount.hpp.
Set this object using the information provided in info.
info | the IdToValue object to which this object shall be set. |
Reimplemented from gnsstk::GPSWeek.
Definition at line 174 of file GPSWeekZcount.cpp.
GPSWeekZcount & gnsstk::GPSWeekZcount::setZcount29 | ( | unsigned int | z | ) |
Definition at line 230 of file GPSWeekZcount.cpp.
GPSWeekZcount & gnsstk::GPSWeekZcount::setZcount32 | ( | unsigned int | z | ) |
Definition at line 237 of file GPSWeekZcount.cpp.
|
static |
This is just a 19-bit mask.
Definition at line 59 of file GPSWeekZcount.hpp.
unsigned int gnsstk::GPSWeekZcount::zcount |
Definition at line 371 of file GPSWeekZcount.hpp.