This class is an abstract base class inherited by other GPS-time-related classes. It is abstract because it does not fulfill the abstract methods imposed by the TimeTag class. It handles the week portion of the GPS TimeTag classes.
All of the GPS time classes can be boiled down to just two basic types: GPSWeekZcount and GPSWeekSecond. GPSWeekZcount consists of an integer week and integer zcount. GPSWeekSecond consists of an integer week and double second.
The GPSWeek class inherits from TimeTag and handles the epoch and 10-bit week special cases: getEpoch() returns week / 1024, getWeek10() returns week % 1024, getEpochWeek10(int& e, int& w) e = getEpoch(); w = getWeek10(); setEpoch(int e) sets week = (week & 0x3FF) | (e << 10); setWeek10(int w) sets week = (week & ~0x3FF) | (w & 0x3FF); setEpochWeek10(int e, int w) calls setEpoch(e); setWeek(w);
GPSWeekZcount inherits from GPSWeek and covers all Zcount-related special cases: getZcount29() returns (getWeek10() << 19) | getZcount() getZcount32() returns (getWeek() << 19) | getZcount()
setZcount29(int z) sets week = (z >> 19) & 0x3FF; zcount = z & 0x7FFFF; setZcount32(int z) sets week = z >> 19; zcount = z & 07FFFF;
GPSWeekSecond inherits from GPSWeek. I don't know of any special cases related to second-of-week.
Definition at line 82 of file GPSWeek.hpp.
#include <GPSWeek.hpp>
Public Member Functions | |
GPSWeek (int w=0, TimeSystem ts=TimeSystem::Unknown) | |
Constructor. More... | |
GPSWeek & | operator= (const GPSWeek &right) |
Assignment Operator. More... | |
virtual | ~GPSWeek () |
Virtual Destructor. More... | |
Comparison Operators. | |
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 std::string | asString () const |
bool | changeTimeSystem (TimeSystem timeSys) |
bool | changeTimeSystem (TimeSystem timeSys, TimeSystemConverter *conv) |
virtual void | convertFromCommonTime (const CommonTime &ct)=0 |
virtual CommonTime | convertToCommonTime () const =0 |
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 GNSSTK_EXPORT int | bits10 = 0x3FF |
static const GNSSTK_EXPORT int | MAX_WEEK =(CommonTime::END_LIMIT_JDAY-MJD_JDAY-GPS_EPOCH_MJD)/7 |
Special Epoch and 10-bit Week Methods. | |
| |
int | week |
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 | 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... | |
virtual unsigned int | getDayOfWeek () const =0 |
Force this interface on this classes descendants. More... | |
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) |
![]() | |
TimeSystem | timeSystem |
time system (representation) of the data More... | |
|
inline |
Constructor.
Definition at line 93 of file GPSWeek.hpp.
|
inlinevirtual |
Virtual Destructor.
Definition at line 99 of file GPSWeek.hpp.
|
pure virtual |
Force this interface on this classes descendants.
Implemented in gnsstk::GPSWeekZcount.
|
inlinevirtual |
Return a string containing the default format to use in printing.
Implements gnsstk::TimeTag.
Reimplemented in gnsstk::GPSWeekZcount.
Definition at line 253 of file GPSWeek.hpp.
|
inlinevirtual |
Definition at line 192 of file GPSWeek.hpp.
|
inlinevirtual |
Definition at line 202 of file GPSWeek.hpp.
|
inlinevirtual |
Return a string containing the characters that this class understands when printing times.
Implements gnsstk::TimeTag.
Reimplemented in gnsstk::GPSWeekZcount.
Definition at line 247 of file GPSWeek.hpp.
|
inlinevirtual |
Definition at line 197 of file GPSWeek.hpp.
|
inlinevirtual |
Returns true if this object's members are valid, false otherwise.
Implements gnsstk::TimeTag.
Reimplemented in gnsstk::GPSWeekZcount.
Definition at line 258 of file GPSWeek.hpp.
Any (wildcard) type exception allowed, otherwise must be same time systems
Definition at line 118 of file GPSWeek.hpp.
Any (wildcard) type exception allowed, otherwise must be same time systems
Definition at line 132 of file GPSWeek.hpp.
Any (wildcard) type exception allowed, otherwise must be same time systems
Definition at line 146 of file GPSWeek.hpp.
Assignment Operator.
Definition at line 48 of file GPSWeek.cpp.
Any (wildcard) type exception allowed, otherwise must be same time systems
Definition at line 107 of file GPSWeek.hpp.
Any (wildcard) type exception allowed, otherwise must be same time systems
Definition at line 160 of file GPSWeek.hpp.
Any (wildcard) type exception allowed, otherwise must be same time systems
Definition at line 174 of file GPSWeek.hpp.
|
virtual |
This function works similarly to printf. Instead of filling the format with data, it fills with error messages.
Implements gnsstk::TimeTag.
Reimplemented in gnsstk::GPSWeekZcount.
Definition at line 78 of file GPSWeek.cpp.
|
virtual |
This function formats this time to a string. The exceptions thrown would only be due to problems parsing the fmt string.
Implements gnsstk::TimeTag.
Reimplemented in gnsstk::GPSWeekZcount.
Definition at line 55 of file GPSWeek.cpp.
|
inlinevirtual |
Reset this object to the default state.
Implements gnsstk::TimeTag.
Reimplemented in gnsstk::GPSWeekZcount.
Definition at line 263 of file GPSWeek.hpp.
|
inlinevirtual |
Definition at line 209 of file GPSWeek.hpp.
|
inlinevirtual |
Definition at line 221 of file GPSWeek.hpp.
Set this object using the information provided in info.
info | the IdToValue object to which this object shall be set. |
Implements gnsstk::TimeTag.
Reimplemented in gnsstk::GPSWeekZcount.
Definition at line 107 of file GPSWeek.cpp.
|
inlinevirtual |
Definition at line 215 of file GPSWeek.hpp.
|
static |
This is a 10-bit mask used in the several special Epoch and 10-bit Week methods.
Definition at line 87 of file GPSWeek.hpp.
|
static |
This is the greatest week value for which a conversion to or from CommonTime would work.
Definition at line 90 of file GPSWeek.hpp.
int gnsstk::GPSWeek::week |
Definition at line 271 of file GPSWeek.hpp.