Static Public Attributes | List of all members
gnsstk::GPSWeekZcount Class Reference

Detailed Description

This class encapsulates the "Full GPS Week and GPS Z-count" time representation.

Definition at line 55 of file GPSWeekZcount.hpp.

#include <GPSWeekZcount.hpp>

Inheritance diagram for gnsstk::GPSWeekZcount:
Inheritance graph
[legend]

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)
 
GPSWeekZcountoperator= (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.
Note
The 29- and 32-bit Zcounts cannot represent time from GPS weeks over 1023 and 8191 respectively.
unsigned int getZcount29 () const
 
unsigned int getZcount32 () const
 
GPSWeekZcountsetZcount29 (unsigned int z)
 
GPSWeekZcountsetZcount32 (unsigned int z)
 
virtual unsigned int getDayOfWeek () const
 Force this interface on this classes descendants. More...
 
- Public Member Functions inherited from gnsstk::GPSWeek
 GPSWeek (int w=0, TimeSystem ts=TimeSystem::Unknown)
 Constructor. More...
 
GPSWeekoperator= (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)
 
- Public Member Functions inherited from gnsstk::TimeTag
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 Public Attributes inherited from gnsstk::GPSWeek
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
 
GPSWeekZcountaddWeeks (short inWeeks)
 
GPSWeekZcountaddZcounts (long inZcounts)
 
GPSWeekZcount operator++ (int)
 
GPSWeekZcountoperator++ ()
 
GPSWeekZcount operator-- (int)
 
GPSWeekZcountoperator-- ()
 
GPSWeekZcount operator+ (long inZcounts) const
 
GPSWeekZcount operator- (long inZcounts) const
 
long operator- (const GPSWeekZcount &right) const noexcept
 
GPSWeekZcountoperator+= (long inZcounts)
 
GPSWeekZcountoperator-= (long inZcounts)
 
bool inSameTimeBlock (const GPSWeekZcount &other, unsigned long inZcountBlock, unsigned long inZcountOffset=0) noexcept
 

Additional Inherited Members

- Public Types inherited from gnsstk::TimeTag
typedef std::map< char, std::string > IdToValue
 
- Static Public Member Functions inherited from gnsstk::TimeTag
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)
 
- Public Attributes inherited from gnsstk::GPSWeek
int week
 
- Protected Attributes inherited from gnsstk::TimeTag
TimeSystem timeSystem
 time system (representation) of the data More...
 

Constructor & Destructor Documentation

◆ GPSWeekZcount() [1/4]

gnsstk::GPSWeekZcount::GPSWeekZcount ( int  w = 0,
int  z = 0,
TimeSystem  ts = TimeSystem::GPS 
)
inline

Default Constructor. All elements are initialized to zero.

Definition at line 69 of file GPSWeekZcount.hpp.

◆ GPSWeekZcount() [2/4]

gnsstk::GPSWeekZcount::GPSWeekZcount ( const GPSWeekZcount right)
inline

Copy Constructor.

Parameters
righta reference to the GPSWeekZcount object to copy

Definition at line 79 of file GPSWeekZcount.hpp.

◆ GPSWeekZcount() [3/4]

gnsstk::GPSWeekZcount::GPSWeekZcount ( const TimeTag right)
inline

Alternate Copy Constructor. Takes a const TimeTag reference and copies its contents via conversion to CommonTime.

Parameters
righta const reference to the BasicTime object to copy
Exceptions
InvalidRequeston over-/under-flow

Definition at line 90 of file GPSWeekZcount.hpp.

◆ GPSWeekZcount() [4/4]

gnsstk::GPSWeekZcount::GPSWeekZcount ( const CommonTime right)
inline

Alternate Copy Constructor. Takes a const CommonTime reference and copies its contents via the convertFromCommonTime method.

Parameters
righta const reference to the CommonTime object to copy
Exceptions
InvalidRequeston over-/under-flow

Definition at line 102 of file GPSWeekZcount.hpp.

◆ ~GPSWeekZcount()

virtual gnsstk::GPSWeekZcount::~GPSWeekZcount ( )
inlinevirtual

Virtual Destructor.

Definition at line 115 of file GPSWeekZcount.hpp.

Member Function Documentation

◆ addWeeks()

GPSWeekZcount & gnsstk::GPSWeekZcount::addWeeks ( short  inWeeks)

Add the given number of weeks to the current value.

Parameters
[in]inWeeksthe number of weeks to add to the current value.
Returns
a reference to this object
Exceptions
gnsstk::InvalidRequestif adding inWeeks would render this object invalid.

Definition at line 245 of file GPSWeekZcount.cpp.

◆ addZcounts()

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.

Parameters
[in]inZcountsthe number of Z-counts to add to the current value.
Returns
a reference to this object.
Exceptions
gnsstk::InvalidRequestif adding inZcounts would render this object invalid.

Definition at line 257 of file GPSWeekZcount.cpp.

◆ convertFromCommonTime()

void gnsstk::GPSWeekZcount::convertFromCommonTime ( const CommonTime ct)
virtual
Exceptions
InvalidRequestif 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.

◆ convertToCommonTime()

CommonTime gnsstk::GPSWeekZcount::convertToCommonTime ( ) const
virtual
Exceptions
InvalidRequestif this TimeTag cannot be correctly represented by a CommonTime object.

Implements gnsstk::TimeTag.

Definition at line 68 of file GPSWeekZcount.cpp.

◆ getDayOfWeek()

virtual unsigned int gnsstk::GPSWeekZcount::getDayOfWeek ( ) const
inlinevirtual

Force this interface on this classes descendants.

Implements gnsstk::GPSWeek.

Definition at line 183 of file GPSWeekZcount.hpp.

◆ getDefaultFormat()

virtual std::string gnsstk::GPSWeekZcount::getDefaultFormat ( ) const
inlinevirtual

Return a string containing the default format to use in printing.

Reimplemented from gnsstk::GPSWeek.

Definition at line 148 of file GPSWeekZcount.hpp.

◆ getPrintChars()

virtual std::string gnsstk::GPSWeekZcount::getPrintChars ( ) const
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.

◆ getTotalZcounts()

unsigned long gnsstk::GPSWeekZcount::getTotalZcounts ( ) const
inlinenoexcept

Calculate the total number of Z-counts in this object.

Returns
weeks * ZCOUNT_PER_WEEK + zcount

Definition at line 244 of file GPSWeekZcount.hpp.

◆ getZcount29()

unsigned int gnsstk::GPSWeekZcount::getZcount29 ( ) const
inline

Definition at line 168 of file GPSWeekZcount.hpp.

◆ getZcount32()

unsigned int gnsstk::GPSWeekZcount::getZcount32 ( ) const
inline

Definition at line 173 of file GPSWeekZcount.hpp.

◆ inSameTimeBlock()

bool gnsstk::GPSWeekZcount::inSameTimeBlock ( const GPSWeekZcount other,
unsigned long  inZcountBlock,
unsigned long  inZcountOffset = 0 
)
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.

Parameters
[in]otherThe other GPSWeekZcount object.
[in]inZcountBlockThe number of Z-counts in a time-block.
[in]inZcountOffsetThe number of Z-counts to offset the time-block (default = 0).
Returns
true if this object and other are in the same time-block.

Definition at line 367 of file GPSWeekZcount.cpp.

◆ isValid()

virtual bool gnsstk::GPSWeekZcount::isValid ( ) const
inlinevirtual

Returns true if this object's members are valid, false otherwise.

Reimplemented from gnsstk::GPSWeek.

Definition at line 153 of file GPSWeekZcount.hpp.

◆ operator!=()

bool gnsstk::GPSWeekZcount::operator!= ( const GPSWeekZcount right) const
inline

Definition at line 202 of file GPSWeekZcount.hpp.

◆ operator+()

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.

Parameters
[in]inZcountsthe number of Z-counts to add to the current value.
Returns
a modified GPSWeekZcount object.
Exceptions
gnsstk::InvalidRequestif adding inZcounts would render this object invalid.

Definition at line 335 of file GPSWeekZcount.cpp.

◆ operator++() [1/2]

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.

Returns
a reference to this object.
Exceptions
gnsstk::InvalidRequestif adding inZcounts would render this object invalid.

Definition at line 315 of file GPSWeekZcount.cpp.

◆ operator++() [2/2]

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.

Returns
a GPSWeekZcount with the value of this object before the increment.
Exceptions
gnsstk::InvalidRequestif adding inZcounts would render this object invalid.

Definition at line 307 of file GPSWeekZcount.cpp.

◆ operator+=()

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.

Parameters
[in]inZcountsthe number of Z-counts to add to the current value.
Returns
a reference to this object.
Exceptions
gnsstk::InvalidRequestif adding inZcounts would render this object invalid.

Definition at line 355 of file GPSWeekZcount.cpp.

◆ operator-() [1/2]

long gnsstk::GPSWeekZcount::operator- ( const GPSWeekZcount right) const
noexcept

Compute the time difference between this object and right.

Parameters
[in]rightthe GPSWeekZcount to subtract from this object.
Returns
the number of Z-counts between this object and right

Definition at line 347 of file GPSWeekZcount.cpp.

◆ operator-() [2/2]

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.

Parameters
[in]inZcountsthe number of Z-counts to subtract from the current value.
Returns
a modified GPSWeekZcount object.
Exceptions
gnsstk::InvalidRequestif adding inZcounts would render this object invalid.

Definition at line 341 of file GPSWeekZcount.cpp.

◆ operator--() [1/2]

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.

Returns
a reference to this object.
Exceptions
gnsstk::InvalidRequestif a Z-count decrement would render this object invalid.

Definition at line 329 of file GPSWeekZcount.cpp.

◆ operator--() [2/2]

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.

Returns
a GPSWeekZcount with the value of this object before the decrement.
Exceptions
gnsstk::InvalidRequestif a Z-count decrement would render this object invalid.

Definition at line 321 of file GPSWeekZcount.cpp.

◆ operator-=()

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.

Parameters
[in]inZcountsthe number of Z-counts to subtract from the current value.
Returns
a reference to this object.
Exceptions
gnsstk::InvalidRequestif adding inZcounts would render this object invalid.

Definition at line 361 of file GPSWeekZcount.cpp.

◆ operator<()

bool gnsstk::GPSWeekZcount::operator< ( const GPSWeekZcount right) const
inline

Definition at line 207 of file GPSWeekZcount.hpp.

◆ operator<=()

bool gnsstk::GPSWeekZcount::operator<= ( const GPSWeekZcount right) const
inline

Definition at line 229 of file GPSWeekZcount.hpp.

◆ operator=()

GPSWeekZcount & gnsstk::GPSWeekZcount::operator= ( const GPSWeekZcount right)

Assignment Operator.

Parameters
righta const reference to the GPSWeekZcount to copy
Returns
a reference to this GPSWeekZcount

Definition at line 61 of file GPSWeekZcount.cpp.

◆ operator==()

bool gnsstk::GPSWeekZcount::operator== ( const GPSWeekZcount right) const
inline

Definition at line 197 of file GPSWeekZcount.hpp.

◆ operator>()

bool gnsstk::GPSWeekZcount::operator> ( const GPSWeekZcount right) const
inline

Definition at line 224 of file GPSWeekZcount.hpp.

◆ operator>=()

bool gnsstk::GPSWeekZcount::operator>= ( const GPSWeekZcount right) const
inline

Definition at line 234 of file GPSWeekZcount.hpp.

◆ printError()

std::string gnsstk::GPSWeekZcount::printError ( const std::string &  fmt) const
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.

◆ printf()

std::string gnsstk::GPSWeekZcount::printf ( const std::string &  fmt) const
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.

◆ reset()

virtual void gnsstk::GPSWeekZcount::reset ( )
inlinevirtual

Reset this object to the default state.

Reimplemented from gnsstk::GPSWeek.

Definition at line 158 of file GPSWeekZcount.hpp.

◆ setFromInfo()

bool gnsstk::GPSWeekZcount::setFromInfo ( const IdToValue info)
virtual

Set this object using the information provided in info.

Parameters
infothe IdToValue object to which this object shall be set.
Returns
true if this object was successfully set using the data in info, false if not.

Reimplemented from gnsstk::GPSWeek.

Definition at line 174 of file GPSWeekZcount.cpp.

◆ setZcount29()

GPSWeekZcount & gnsstk::GPSWeekZcount::setZcount29 ( unsigned int  z)

Definition at line 230 of file GPSWeekZcount.cpp.

◆ setZcount32()

GPSWeekZcount & gnsstk::GPSWeekZcount::setZcount32 ( unsigned int  z)

Definition at line 237 of file GPSWeekZcount.cpp.

Member Data Documentation

◆ bits19

const unsigned int gnsstk::GPSWeekZcount::bits19 = 0x7FFFF
static

This is just a 19-bit mask.

Definition at line 59 of file GPSWeekZcount.hpp.

◆ zcount

unsigned int gnsstk::GPSWeekZcount::zcount

Definition at line 371 of file GPSWeekZcount.hpp.


The documentation for this class was generated from the following files:


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