This class is an abstract base class inherited by other time-related classes that use a "week number + seconds of week" formulation; this includes GPS, GAL, BDS and QZS. It handles only the week number, including rollover and the modulo operation; class WeekSecond inherits this class and handles the seconds-of-week.
The class is abstract because it does not fulfill the abstract methods of the TimeTag class, and because the routines defining the number of bits in the "ModWeek" and the starting epoch are not defined.
The Week class inherits from TimeTag and handles the epoch and N-bit week special cases: getEpoch() returns int (week / rollover) or the number of rollovers, getWeek() returns full week getModWeek() returns week % rollover or the "short week" getEpochModWeek(int& e, int& w) e = getEpoch(); w = getModWeek(); setEpoch(int e) sets week = (week & bitmask) | (e << Nbits); setModWeek(int w) sets week = (week & ~bitmask) | (w & bitmask); setEpochModWeek(int e, int w) calls setEpoch(e); setWeek(w);
#include <Week.hpp>
Public Member Functions | |
virtual int | bitmask (void) const =0 |
int | MAXWEEK (void) const |
virtual long | MJDEpoch (void) const =0 |
virtual int | Nbits (void) const =0 |
Week & | operator= (const Week &right) |
Assignment Operator. More... | |
virtual int | rollover (void) const |
Week (int w=0, TimeSystem ts=TimeSystem::Unknown) | |
Constructor. More... | |
virtual | ~Week () |
Virtual Destructor. More... | |
Comparison Operators. | |
bool | operator== (const Week &right) const |
bool | operator!= (const Week &right) const |
bool | operator< (const Week &right) const |
bool | operator<= (const Week &right) const |
bool | operator> (const Week &right) const |
bool | operator>= (const Week &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 std::string | printError (const std::string &fmt) const =0 |
virtual std::string | printf (const std::string &fmt) const =0 |
virtual void | scanf (const std::string &str, const std::string &fmt) |
virtual bool | setFromInfo (const IdToValue &info)=0 |
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... | |
Special Epoch and Nbit Week Methods. | |
int | week |
Full week number. More... | |
virtual unsigned int | getWeek () const |
virtual unsigned int | getModWeek () const |
virtual unsigned int | getEpoch () const |
virtual void | getEpochModWeek (unsigned int &e, unsigned int &w) const |
virtual void | setEpoch (unsigned int e) |
virtual void | setModWeek (unsigned int w) |
virtual void | setEpochModWeek (unsigned int e, unsigned int w) |
virtual void | adjustToYear (unsigned int y) |
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 |
|
inlinevirtual |
|
inlinevirtual |
|
pure virtual |
Return the bitmask used to get the ModWeek from the full week. This is pure virtual and must be implemented in the derived class; e.g. GPSWeek::bitmask(void) { static const int bm=0x3FF; return bm; }
Implemented in gnsstk::BDSWeekSecond, gnsstk::IRNWeekSecond, gnsstk::QZSWeekSecond, gnsstk::GALWeekSecond, and gnsstk::GPSWeekSecond.
|
pure virtual |
Force this interface on this classes descendants.
Implemented in gnsstk::WeekSecond.
|
inlinevirtual |
Return a string containing the default format to use in printing.
Implements gnsstk::TimeTag.
Reimplemented in gnsstk::GPSWeekSecond, gnsstk::BDSWeekSecond, gnsstk::IRNWeekSecond, gnsstk::QZSWeekSecond, and gnsstk::GALWeekSecond.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Return a string containing the characters that this class understands when printing times.
Implements gnsstk::TimeTag.
Reimplemented in gnsstk::GPSWeekSecond, gnsstk::BDSWeekSecond, gnsstk::IRNWeekSecond, gnsstk::QZSWeekSecond, and gnsstk::GALWeekSecond.
|
inlinevirtual |
|
inlinevirtual |
Returns true if this object's members are valid, false otherwise.
Implements gnsstk::TimeTag.
Reimplemented in gnsstk::WeekSecond.
|
inline |
Return the greatest week value for which a conversion to or from CommonTime would work.
|
pure virtual |
Return the Modified Julian Date (MJD) of epoch for this system. This is pure virtual and must be implemented in the derived class; e.g. long GPSWeek::MJDEpoch(void) { static const long e=GPS_EPOCH_MJD; return e; }
Implemented in gnsstk::BDSWeekSecond, gnsstk::IRNWeekSecond, gnsstk::QZSWeekSecond, gnsstk::GALWeekSecond, and gnsstk::GPSWeekSecond.
|
pure virtual |
Return the number of bits in the bitmask used to get the ModWeek from the full week. This is pure virtual and must be implemented in the derived class; e.g. GPSWeek::Nbits(void) { static const int n=10; return n; }
Implemented in gnsstk::BDSWeekSecond, gnsstk::IRNWeekSecond, gnsstk::QZSWeekSecond, gnsstk::GALWeekSecond, and gnsstk::GPSWeekSecond.
|
inlinevirtual |
Reset this object to the default state.
Implements gnsstk::TimeTag.
Reimplemented in gnsstk::WeekSecond.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |