GPSWeek Class Reference

#include <GPSWeek.hpp>

Inheritance diagram for GPSWeek:

Inheritance graph
[legend]
Collaboration diagram for GPSWeek:

Collaboration graph
[legend]
List of all members.

Detailed Description

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 78 of file GPSWeek.hpp.

Public Member Functions

 GPSWeek (int w=0, TimeSystem ts=TimeSystem::Unknown) throw ()
 Constructor.
virtual ~GPSWeek () throw ()
 Virtual Destructor.
GPSWeekoperator= (const GPSWeek &right) throw ()
 Assignment Operator.
virtual std::string printf (const std::string &fmt) const throw ( gpstk::StringUtils::StringException )
 This function formats this time to a string.
virtual std::string printError (const std::string &fmt) const throw ( gpstk::StringUtils::StringException )
 This function works similarly to printf.
virtual bool setFromInfo (const IdToValue &info) throw ()
 Set this object using the information provided in info.
virtual std::string getPrintChars () const throw ()
 Return a string containing the characters that this class understands when printing times.
virtual std::string getDefaultFormat () const throw ()
 Return a string containing the default format to use in printing.
virtual bool isValid () const throw ()
 Returns true if this object's members are valid, false otherwise.
virtual void reset () throw ()
 Reset this object to the default state.
virtual unsigned int getDayOfWeek () const =0 throw ()
 Force this interface on this classes descendants.
Comparison Operators.
bool operator== (const GPSWeek &right) const throw ()
bool operator!= (const GPSWeek &right) const throw ( gpstk::InvalidRequest )
bool operator< (const GPSWeek &right) const throw ( gpstk::InvalidRequest )
bool operator<= (const GPSWeek &right) const throw ( gpstk::InvalidRequest )
bool operator> (const GPSWeek &right) const throw ( gpstk::InvalidRequest )
bool operator>= (const GPSWeek &right) const throw ( gpstk::InvalidRequest )
Special Epoch and 10-bit Week Methods.
Todo:
Should the "set" methods return a reference?


virtual unsigned int getEpoch () const throw ()
virtual unsigned int getWeek10 () const throw ()
virtual void getEpochWeek10 (unsigned int &e, unsigned int &w) const throw ()
virtual void setEpoch (unsigned int e) throw ()
virtual void setWeek10 (unsigned int w) throw ()
virtual void setEpochWeek10 (unsigned int e, unsigned int w) throw ()

Public Attributes

int week

Static Public Attributes

const int bits10 = 0x3FF
 This is a 10-bit mask used in the several special Epoch and 10-bit Week methods.
const int MAX_WEEK = (CommonTime::END_LIMIT_JDAY - GPS_EPOCH_JDAY)/7
 This is the greatest week value for which a conversion to or from CommonTime would work.


Constructor & Destructor Documentation

GPSWeek int  w = 0,
TimeSystem  ts = TimeSystem::Unknown
throw () [inline]
 

Constructor.

Definition at line 89 of file GPSWeek.hpp.

virtual ~GPSWeek  )  throw () [inline, virtual]
 

Virtual Destructor.

Definition at line 96 of file GPSWeek.hpp.


Member Function Documentation

virtual unsigned int getDayOfWeek  )  const throw () [pure virtual]
 

Force this interface on this classes descendants.

Implemented in GPSWeekSecond, and GPSWeekZcount.

virtual std::string getDefaultFormat  )  const throw () [inline, virtual]
 

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

Implements TimeTag.

Reimplemented in GPSWeekSecond, and GPSWeekZcount.

Definition at line 268 of file GPSWeek.hpp.

virtual unsigned int getEpoch  )  const throw () [inline, virtual]
 

Definition at line 197 of file GPSWeek.hpp.

virtual void getEpochWeek10 unsigned int &  e,
unsigned int &  w
const throw () [inline, virtual]
 

Definition at line 209 of file GPSWeek.hpp.

virtual std::string getPrintChars  )  const throw () [inline, virtual]
 

Return a string containing the characters that this class understands when printing times.

Implements TimeTag.

Reimplemented in GPSWeekSecond, and GPSWeekZcount.

Definition at line 261 of file GPSWeek.hpp.

virtual unsigned int getWeek10  )  const throw () [inline, virtual]
 

Definition at line 203 of file GPSWeek.hpp.

Referenced by Epoch::set().

virtual bool isValid  )  const throw () [inline, virtual]
 

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

Implements TimeTag.

Reimplemented in GPSWeekSecond, and GPSWeekZcount.

Definition at line 274 of file GPSWeek.hpp.

bool operator!= const GPSWeek right  )  const throw ( gpstk::InvalidRequest ) [inline]
 

Any (wildcard) type exception allowed, otherwise must be same time systems

Definition at line 118 of file GPSWeek.hpp.

References GPSTK_THROW.

bool operator< const GPSWeek right  )  const throw ( gpstk::InvalidRequest ) [inline]
 

Any (wildcard) type exception allowed, otherwise must be same time systems

Definition at line 133 of file GPSWeek.hpp.

References GPSTK_THROW.

bool operator<= const GPSWeek right  )  const throw ( gpstk::InvalidRequest ) [inline]
 

Any (wildcard) type exception allowed, otherwise must be same time systems

Definition at line 148 of file GPSWeek.hpp.

References GPSTK_THROW.

GPSWeek & operator= const GPSWeek right  )  throw ()
 

Assignment Operator.

Definition at line 46 of file GPSWeek.cpp.

bool operator== const GPSWeek right  )  const throw () [inline]
 

Any (wildcard) type exception allowed, otherwise must be same time systems

Definition at line 106 of file GPSWeek.hpp.

bool operator> const GPSWeek right  )  const throw ( gpstk::InvalidRequest ) [inline]
 

Any (wildcard) type exception allowed, otherwise must be same time systems

Definition at line 163 of file GPSWeek.hpp.

References GPSTK_THROW.

bool operator>= const GPSWeek right  )  const throw ( gpstk::InvalidRequest ) [inline]
 

Any (wildcard) type exception allowed, otherwise must be same time systems

Definition at line 178 of file GPSWeek.hpp.

References GPSTK_THROW.

std::string printError const std::string &  fmt  )  const throw ( gpstk::StringUtils::StringException ) [virtual]
 

This function works similarly to printf.

Instead of filling the format with data, it fills with error messages.

Implements TimeTag.

Reimplemented in GPSWeekSecond, and GPSWeekZcount.

Definition at line 78 of file GPSWeek.cpp.

References gpstk::StringUtils::formattedPrint(), and GPSTK_RETHROW.

std::string printf const std::string &  fmt  )  const throw ( gpstk::StringUtils::StringException ) [virtual]
 

This function formats this time to a string.

The exceptions thrown would only be due to problems parsing the fmt string.

Implements TimeTag.

Reimplemented in GPSWeekSecond, and GPSWeekZcount.

Definition at line 54 of file GPSWeek.cpp.

References gpstk::StringUtils::formattedPrint(), and GPSTK_RETHROW.

virtual void reset  )  throw () [inline, virtual]
 

Reset this object to the default state.

Implements TimeTag.

Reimplemented in GPSWeekSecond, and GPSWeekZcount.

Definition at line 280 of file GPSWeek.hpp.

virtual void setEpoch unsigned int  e  )  throw () [inline, virtual]
 

Definition at line 217 of file GPSWeek.hpp.

Referenced by gpstk::mixedScanTime(), and Epoch::set().

virtual void setEpochWeek10 unsigned int  e,
unsigned int  w
throw () [inline, virtual]
 

Definition at line 231 of file GPSWeek.hpp.

bool setFromInfo const IdToValue info  )  throw () [virtual]
 

Set this object using the information provided in info.

Parameters:
info the 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.

Implements TimeTag.

Reimplemented in GPSWeekSecond, and GPSWeekZcount.

Definition at line 108 of file GPSWeek.cpp.

References gpstk::StringUtils::asInt().

virtual void setWeek10 unsigned int  w  )  throw () [inline, virtual]
 

Definition at line 224 of file GPSWeek.hpp.

Referenced by gpstk::mixedScanTime().


Member Data Documentation

const int bits10 = 0x3FF [static]
 

This is a 10-bit mask used in the several special Epoch and 10-bit Week methods.

Definition at line 83 of file GPSWeek.hpp.

const int MAX_WEEK = (CommonTime::END_LIMIT_JDAY - GPS_EPOCH_JDAY)/7 [static]
 

This is the greatest week value for which a conversion to or from CommonTime would work.

Definition at line 44 of file GPSWeek.cpp.

int week
 

Definition at line 290 of file GPSWeek.hpp.

Referenced by BrcKeplerOrbit::getFullWeek(), BrcClockCorrection::getFullWeek(), gpstk::mixedScanTime(), Epoch::operator GPSZcount(), PRSolution2::RAIMCompute(), Epoch::set(), and OrbElem::timeDisplay().


The documentation for this class was generated from the following files:
Generated on Wed May 22 03:31:55 2013 for GPS ToolKit Software Library by  doxygen 1.3.9.1