YDSTime Class Reference

#include <YDSTime.hpp>

Inheritance diagram for YDSTime:

Inheritance graph
[legend]
Collaboration diagram for YDSTime:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class encapsulates the "year, day-of-year, and seconds-of-day" time format.

Definition at line 38 of file YDSTime.hpp.

Public Member Functions

 YDSTime (long y=0, long d=0, double s=0.) throw ()
 Default Constructor.
 YDSTime (const YDSTime &right) throw ()
 Copy Constructor.
 YDSTime (const TimeTag &right) throw ( InvalidRequest )
 Alternate Copy Constructor.
 YDSTime (const CommonTime &right) throw ()
 Alternate Copy Constructor.
YDSTimeoperator= (const YDSTime &right) throw ()
 Assignment Operator.
virtual ~YDSTime () throw ()
 Virtual Destructor.
virtual CommonTime convertToCommonTime () const throw (InvalidRequest)
 
Exceptions:
InvalidRequest if this TimeTag cannot be correctly represented by a CommonTime object.

virtual void convertFromCommonTime (const CommonTime &ct) throw ()
 
Exceptions:
InvalidRequest if ct cannot be correctly represented in this TimeTag object.

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.
bool operator== (const YDSTime &right) const throw ()
bool operator!= (const YDSTime &right) const throw ()
bool operator< (const YDSTime &right) const throw ()
bool operator> (const YDSTime &right) const throw ()
bool operator<= (const YDSTime &right) const throw ()
bool operator>= (const YDSTime &right) const throw ()

Public Attributes

int year
int doy
double sod


Member Function Documentation

void convertFromCommonTime const CommonTime ct  )  throw () [virtual]
 

Exceptions:
InvalidRequest if ct cannot be correctly represented in this TimeTag object.

Implements TimeTag.

Definition at line 56 of file YDSTime.cpp.

References gpstk::convertCalendarToJD(), and gpstk::convertJDtoCalendar().

Referenced by YDSTime::isValid().

CommonTime convertToCommonTime  )  const throw (InvalidRequest) [virtual]
 

Exceptions:
InvalidRequest if this TimeTag cannot be correctly represented by a CommonTime object.

Implements TimeTag.

Definition at line 41 of file YDSTime.cpp.

References gpstk::convertCalendarToJD(), YDSTime::doy, GPSTK_THROW, YDSTime::sod, and YDSTime::year.

Referenced by YDSTime::isValid(), gpstk::mixedScanTime(), and gpstk::scanTime().

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

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

Implements TimeTag.

Definition at line 140 of file YDSTime.hpp.

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

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

Implements TimeTag.

Definition at line 133 of file YDSTime.hpp.

bool isValid  )  const throw () [virtual]
 

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

Implements TimeTag.

Definition at line 167 of file YDSTime.cpp.

References YDSTime::convertFromCommonTime(), and YDSTime::convertToCommonTime().

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.

Definition at line 93 of file YDSTime.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.

Definition at line 69 of file YDSTime.cpp.

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

void reset  )  throw () [virtual]
 

Reset this object to the default state.

Implements TimeTag.

Definition at line 179 of file YDSTime.cpp.

References YDSTime::doy, YDSTime::sod, and YDSTime::year.

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.

Definition at line 117 of file YDSTime.cpp.

References gpstk::StringUtils::asDouble(), and gpstk::StringUtils::asInt().

Referenced by Test::otherTest(), and gpstk::scanTime().


Member Data Documentation

int doy
 

Definition at line 175 of file YDSTime.hpp.

Referenced by YDSTime::convertToCommonTime(), gpstk::mixedScanTime(), and YDSTime::reset().

double sod
 

Definition at line 176 of file YDSTime.hpp.

Referenced by YDSTime::convertToCommonTime(), gpstk::mixedScanTime(), YDSTime::reset(), and gpstk::scanTime().

int year
 

Definition at line 174 of file YDSTime.hpp.

Referenced by YDSTime::convertToCommonTime(), gpstk::mixedScanTime(), and YDSTime::reset().


The documentation for this class was generated from the following files:
Generated on Wed Feb 8 03:31:43 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1