MJD Class Reference

#include <MJD.hpp>

Inheritance diagram for MJD:

Inheritance graph
[legend]
Collaboration diagram for MJD:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class encapsulates the "Modified Julian Date" time representation.

Definition at line 37 of file MJD.hpp.

Public Member Functions

 throw ()
 Default Constructor.
 throw ()
 Copy Constructor.
 throw (gpstk::InvalidRequest)
 Alternate Copy Constructor.
 throw ()
 Alternate Copy Constructor.
MJDoperator= (const MJD &right) throw ()
 Assignment Operator.
virtual ~MJD () 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 MJD &right) const throw ()
bool operator!= (const MJD &right) const throw ()
bool operator< (const MJD &right) const throw ()
bool operator> (const MJD &right) const throw ()
bool operator<= (const MJD &right) const throw ()
bool operator>= (const MJD &right) const throw ()

Public Attributes

long double mjd


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 68 of file MJD.cpp.

Referenced by MJD::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 MJD.cpp.

References GPSTK_THROW, MJD::mjd, and gpstk::MJD_JDAY.

Referenced by MJD::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 MJD.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 MJD.hpp.

bool isValid  )  const throw () [virtual]
 

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

Implements TimeTag.

Definition at line 130 of file MJD.cpp.

References MJD::convertFromCommonTime(), and MJD::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 98 of file MJD.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 80 of file MJD.cpp.

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

void reset  )  throw () [virtual]
 

Reset this object to the default state.

Implements TimeTag.

Definition at line 142 of file MJD.cpp.

References MJD::mjd.

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 116 of file MJD.cpp.

References gpstk::StringUtils::asLongDouble().

Referenced by gpstk::scanTime().

throw  )  [inline]
 

Alternate Copy Constructor.

Takes a const CommonTime reference and copies its contents via the convertFromCommonTime method.

Parameters:
right a const reference to the CommonTime object to copy
Exceptions:
InvalidRequest on over-/under-flow

Definition at line 84 of file MJD.hpp.

throw  )  [inline]
 

Copy Constructor.

Parameters:
right a reference to the MJD object to copy

Definition at line 59 of file MJD.hpp.


Member Data Documentation

long double mjd
 

Definition at line 172 of file MJD.hpp.

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


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