ANSITime Class Reference

#include <ANSITime.hpp>

Inheritance diagram for ANSITime:

Inheritance graph
[legend]
Collaboration diagram for ANSITime:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class encapsulates the "ANSITime (seconds since Unix epoch)" time representation.

Definition at line 39 of file ANSITime.hpp.

Public Member Functions

 ANSITime (time_t t=0) throw ()
 Default Constructor.
 ANSITime (const ANSITime &right) throw ()
 Copy Constructor.
 ANSITime (const TimeTag &right) throw ( gpstk::InvalidRequest )
 Alternate Copy Constructor.
 ANSITime (const CommonTime &right) throw ( InvalidRequest )
 Alternate Copy Constructor.
ANSITimeoperator= (const ANSITime &right) throw ()
 Assignment Operator.
virtual ~ANSITime () 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 (InvalidRequest)
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 ANSITime &right) const throw ()
bool operator!= (const ANSITime &right) const throw ()
bool operator< (const ANSITime &right) const throw ()
bool operator> (const ANSITime &right) const throw ()
bool operator<= (const ANSITime &right) const throw ()
bool operator>= (const ANSITime &right) const throw ()

Public Attributes

time_t time


Member Function Documentation

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

This is the earliest CommonTime for which ANSITimes are valid.

This is the latest CommonTime for which ANSITimes are valid. 2^31 - 1 seconds

Implements TimeTag.

Definition at line 55 of file ANSITime.cpp.

References GPSTK_THROW, gpstk::MJD_JDAY, and gpstk::SEC_PER_DAY.

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

References GPSTK_THROW, gpstk::MJD_JDAY, gpstk::SEC_PER_DAY, ANSITime::time, and gpstk::UNIX_MJD.

Referenced by ANSITime::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 142 of file ANSITime.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 135 of file ANSITime.hpp.

bool isValid  )  const throw () [virtual]
 

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

Implements TimeTag.

Definition at line 128 of file ANSITime.cpp.

References ANSITime::convertFromCommonTime(), and ANSITime::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 96 of file ANSITime.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 78 of file ANSITime.cpp.

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

void reset  )  throw () [virtual]
 

Reset this object to the default state.

Implements TimeTag.

Definition at line 140 of file ANSITime.cpp.

References ANSITime::time.

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 114 of file ANSITime.cpp.

References gpstk::StringUtils::asInt().

Referenced by gpstk::scanTime().


Member Data Documentation

time_t time
 

Definition at line 176 of file ANSITime.hpp.

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


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