CivilTime Class Reference

#include <CivilTime.hpp>

Inheritance diagram for CivilTime:

Inheritance graph
[legend]
Collaboration diagram for CivilTime:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class encapsulates the representation of time consisting of year, month, day (of month), hour (of day), minute (of hour), and second (of minute).

Definition at line 52 of file CivilTime.hpp.

Public Member Functions

 CivilTime (int yr=0, int mo=0, int dy=0, int hr=0, int mn=0, double s=0.0, TimeSystem ts=TimeSystem::Unknown) throw ()
 Default Constructor.
 CivilTime (const CivilTime &right) throw ()
 Copy Constructor.
 CivilTime (const TimeTag &right) throw ()
 Alternate Copy Constructor.
 CivilTime (const CommonTime &right) throw ()
 Alternate Copy Constructor.
CivilTimeoperator= (const CivilTime &right) throw ()
 Assignment Operator.
virtual ~CivilTime () throw ()
 Virtual Destructor.
virtual CommonTime convertToCommonTime () const throw ( gpstk::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 CivilTime &right) const throw ()
bool operator!= (const CivilTime &right) const throw ()
bool operator< (const CivilTime &right) const throw ( gpstk::InvalidRequest )
bool operator> (const CivilTime &right) const throw ( gpstk::InvalidRequest )
bool operator<= (const CivilTime &right) const throw ( gpstk::InvalidRequest )
bool operator>= (const CivilTime &right) const throw ( gpstk::InvalidRequest )

Public Attributes

int year
int month
int day
int hour
int minute
double second

Static Public Attributes

const char * MonthNames []
 Long month names for converstion from numbers to strings.
const char * MonthAbbrevNames []
 Short month names for converstion from numbers to strings.


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 97 of file CivilTime.cpp.

References gpstk::convertJDtoCalendar(), gpstk::convertSODtoTime(), and CommonTime::get().

Referenced by CivilTime::isValid().

CommonTime convertToCommonTime  )  const throw ( gpstk::InvalidRequest ) [virtual]
 

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

Implements TimeTag.

Definition at line 74 of file CivilTime.cpp.

References gpstk::convertCalendarToJD(), gpstk::convertTimeToSOD(), CivilTime::day, GPSTK_THROW, CivilTime::hour, CivilTime::minute, CivilTime::month, CivilTime::second, CommonTime::set(), and CivilTime::year.

Referenced by CivilTime::isValid(), ProblemSatFilter::loadSatelliteProblemFile(), gpstk::mixedScanTime(), ConfDataItem::parse(), gpstk::reallyGetRecordVer2(), 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 167 of file CivilTime.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 160 of file CivilTime.hpp.

bool isValid  )  const throw () [virtual]
 

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

Implements TimeTag.

Definition at line 281 of file CivilTime.cpp.

References CivilTime::convertFromCommonTime(), and CivilTime::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 150 of file CivilTime.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 112 of file CivilTime.cpp.

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

Referenced by SP3Header::dump(), gpstk::operator<<(), SP3Header::reallyPutRecord(), and SP3Data::reallyPutRecord().

void reset  )  throw () [virtual]
 

Reset this object to the default state.

Implements TimeTag.

Definition at line 293 of file CivilTime.cpp.

References CivilTime::day, CivilTime::hour, CivilTime::minute, CivilTime::month, CivilTime::second, and CivilTime::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 188 of file CivilTime.cpp.

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

Referenced by gpstk::scanTime().


Member Data Documentation

int day
 

Definition at line 203 of file CivilTime.hpp.

Referenced by CivilTime::convertToCommonTime(), ConfDataItem::format(), gpstk::mixedScanTime(), Rinex3NavHeader::reallyGetRecord(), and CivilTime::reset().

int hour
 

Definition at line 204 of file CivilTime.hpp.

Referenced by CivilTime::convertToCommonTime(), ConfDataItem::format(), gpstk::mixedScanTime(), CivilTime::reset(), and gpstk::scanTime().

int minute
 

Definition at line 205 of file CivilTime.hpp.

Referenced by CivilTime::convertToCommonTime(), ConfDataItem::format(), gpstk::mixedScanTime(), CivilTime::reset(), and gpstk::scanTime().

int month
 

Definition at line 202 of file CivilTime.hpp.

Referenced by CivilTime::convertToCommonTime(), ConfDataItem::format(), gpstk::mixedScanTime(), Rinex3NavHeader::reallyGetRecord(), and CivilTime::reset().

const char * MonthAbbrevNames [static]
 

Initial value:

 
   {
      "err", "Jan", "Feb", "Mar", "Apr", "May", "Jun",
             "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
   }
Short month names for converstion from numbers to strings.

Definition at line 55 of file CivilTime.cpp.

const char * MonthNames [static]
 

Initial value:

 
   {
      "Error",
      "January","February", "March", "April",
      "May", "June","July", "August",
      "September", "October", "November", "December"
   }
Long month names for converstion from numbers to strings.

Definition at line 46 of file CivilTime.cpp.

double second
 

Definition at line 206 of file CivilTime.hpp.

Referenced by CivilTime::convertToCommonTime(), SP3Header::dump(), ConfDataItem::format(), gpstk::mixedScanTime(), gpstk::reallyGetRecordVer2(), CivilTime::reset(), and gpstk::scanTime().

int year
 

Definition at line 201 of file CivilTime.hpp.

Referenced by CivilTime::convertToCommonTime(), ConfDataItem::format(), Rinex3NavHeader::reallyGetRecord(), and CivilTime::reset().


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