JulianDate Class Reference

#include <JulianDate.hpp>

Inheritance diagram for JulianDate:

Inheritance graph
[legend]
Collaboration diagram for JulianDate:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class encapsulates the "Julian Date" time representation.

Definition at line 37 of file JulianDate.hpp.

Public Member Functions

 JulianDate (long double j=0.) throw ()
 Default Constructor.
 JulianDate (const JulianDate &right) throw ()
 Copy Constructor.
 JulianDate (const TimeTag &right) throw ( gpstk::InvalidRequest )
 Alternate Copy Constructor.
 JulianDate (const CommonTime &right) throw ( )
 Alternate Copy Constructor.
JulianDateoperator= (const JulianDate &right) throw ()
 Assignment Operator.
virtual ~JulianDate () 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 JulianDate &right) const throw ()
bool operator!= (const JulianDate &right) const throw ()
bool operator< (const JulianDate &right) const throw ()
bool operator> (const JulianDate &right) const throw ()
bool operator<= (const JulianDate &right) const throw ()
bool operator>= (const JulianDate &right) const throw ()

Public Attributes

long double jd


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 60 of file JulianDate.cpp.

References gpstk::DAY_PER_SEC.

Referenced by JulianDate::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 39 of file JulianDate.cpp.

References GPSTK_THROW, and JulianDate::jd.

Referenced by JulianDate::isValid(), 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 138 of file JulianDate.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 131 of file JulianDate.hpp.

bool isValid  )  const throw () [virtual]
 

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

Implements TimeTag.

Definition at line 123 of file JulianDate.cpp.

References JulianDate::convertFromCommonTime(), and JulianDate::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 91 of file JulianDate.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 73 of file JulianDate.cpp.

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

void reset  )  throw () [virtual]
 

Reset this object to the default state.

Implements TimeTag.

Definition at line 135 of file JulianDate.cpp.

References JulianDate::jd.

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 109 of file JulianDate.cpp.

References gpstk::StringUtils::asLongDouble().

Referenced by gpstk::scanTime().


Member Data Documentation

long double jd
 

Definition at line 172 of file JulianDate.hpp.

Referenced by JulianDate::convertToCommonTime(), and JulianDate::reset().


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