List of all members
gnsstk::YDSTime Class Reference

Detailed Description

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

Definition at line 58 of file YDSTime.hpp.

#include <YDSTime.hpp>

Inheritance diagram for gnsstk::YDSTime:
Inheritance graph
[legend]

Public Member Functions

YDSTime Basic Operations
 YDSTime (long y=0, long d=0, double s=0., TimeSystem ts=TimeSystem::Unknown)
 
 YDSTime (const YDSTime &right)
 
 YDSTime (const TimeTag &right)
 
 YDSTime (const CommonTime &right)
 
YDSTimeoperator= (const YDSTime &right)
 
virtual ~YDSTime ()
 Virtual Destructor. More...
 
virtual CommonTime convertToCommonTime () const
 
virtual void convertFromCommonTime (const CommonTime &ct)
 
virtual std::string printf (const std::string &fmt) const
 
virtual std::string printError (const std::string &fmt) const
 
virtual bool setFromInfo (const IdToValue &info)
 
virtual std::string getPrintChars () const
 
virtual std::string getDefaultFormat () const
 Return a string containing the default format to use in printing. More...
 
virtual bool isValid () const
 Returns true if this object's members are valid, false otherwise. More...
 
virtual void reset ()
 Reset this object to the default state. More...
 
- Public Member Functions inherited from gnsstk::TimeTag
virtual std::string asString () const
 
bool changeTimeSystem (TimeSystem timeSys)
 
bool changeTimeSystem (TimeSystem timeSys, TimeSystemConverter *conv)
 
TimeSystem getTimeSystem () const
 Obtain time system info (enum). More...
 
virtual operator CommonTime () const
 
virtual void scanf (const std::string &str, const std::string &fmt)
 
void setTimeSystem (const TimeSystem &timeSys)
 Set method for internal variable timeSystem (enum). More...
 
 TimeTag ()
 Default constructor. More...
 
 TimeTag (const TimeSystem &ts)
 Constructor. More...
 
virtual ~TimeTag ()
 Virtual Destructor. More...
 

Static Public Attributes

YDSTime Time Constants
static const GNSSTK_EXPORT YDSTime BEGIN_TIME
 

YDSTime Comparison Operators

All comparison operators have a parameter "right" which corresponds to the YDSTime object to the right of the symbol. All comparison operators are const and return true on success and false on failure.

int year
 
int doy
 
double sod
 
bool operator== (const YDSTime &right) const
 
bool operator!= (const YDSTime &right) const
 
bool operator< (const YDSTime &right) const
 
bool operator> (const YDSTime &right) const
 
bool operator<= (const YDSTime &right) const
 
bool operator>= (const YDSTime &right) const
 

Additional Inherited Members

- Public Types inherited from gnsstk::TimeTag
typedef std::map< char, std::string > IdToValue
 
- Static Public Member Functions inherited from gnsstk::TimeTag
static void checkTimeSystem (TimeSystem ts1, TimeSystem ts2)
 
static std::string getError ()
 This returns the default error string for the TimeTag classes. More...
 
static std::string getFormatPrefixFloat ()
 
static std::string getFormatPrefixInt ()
 
static void getInfo (const std::string &str, const std::string &fmt, IdToValue &info)
 
- Protected Attributes inherited from gnsstk::TimeTag
TimeSystem timeSystem
 time system (representation) of the data More...
 

Constructor & Destructor Documentation

◆ YDSTime() [1/4]

gnsstk::YDSTime::YDSTime ( long  y = 0,
long  d = 0,
double  s = 0.,
TimeSystem  ts = TimeSystem::Unknown 
)
inline

Default Constructor. All elements are set to zero by default.

Definition at line 80 of file YDSTime.hpp.

◆ YDSTime() [2/4]

gnsstk::YDSTime::YDSTime ( const YDSTime right)
inline

Copy Constructor.

Parameters
righta const reference to the YDSTime object to copy

Definition at line 90 of file YDSTime.hpp.

◆ YDSTime() [3/4]

gnsstk::YDSTime::YDSTime ( const TimeTag right)
inline

Alternate Copy Constructor. Takes a const TimeTag reference and copies its contents via conversion to CommonTime.

Parameters
righta const reference to the TimeTag-based object to copy
Exceptions
InvalidRequeston over-/under-flow

Definition at line 101 of file YDSTime.hpp.

◆ YDSTime() [4/4]

gnsstk::YDSTime::YDSTime ( const CommonTime right)
inline

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

Parameters
righta const reference to the CommonTime object to copy
Exceptions
InvalidRequeston over-/under-flow

Definition at line 113 of file YDSTime.hpp.

◆ ~YDSTime()

virtual gnsstk::YDSTime::~YDSTime ( )
inlinevirtual

Virtual Destructor.

Definition at line 126 of file YDSTime.hpp.

Member Function Documentation

◆ convertFromCommonTime()

void gnsstk::YDSTime::convertFromCommonTime ( const CommonTime ct)
virtual
Exceptions
InvalidRequestif ct cannot be correctly represented in this TimeTag object.

Implements gnsstk::TimeTag.

Definition at line 76 of file YDSTime.cpp.

◆ convertToCommonTime()

CommonTime gnsstk::YDSTime::convertToCommonTime ( ) const
virtual
Exceptions
InvalidRequestif this TimeTag cannot be correctly represented by a CommonTime object.

Implements gnsstk::TimeTag.

Definition at line 61 of file YDSTime.cpp.

◆ getDefaultFormat()

virtual std::string gnsstk::YDSTime::getDefaultFormat ( ) const
inlinevirtual

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

Implements gnsstk::TimeTag.

Definition at line 159 of file YDSTime.hpp.

◆ getPrintChars()

virtual std::string gnsstk::YDSTime::getPrintChars ( ) const
inlinevirtual

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

Implements gnsstk::TimeTag.

Definition at line 153 of file YDSTime.hpp.

◆ isValid()

bool gnsstk::YDSTime::isValid ( ) const
virtual

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

Implements gnsstk::TimeTag.

Definition at line 189 of file YDSTime.cpp.

◆ operator!=()

bool gnsstk::YDSTime::operator!= ( const YDSTime right) const

Definition at line 224 of file YDSTime.cpp.

◆ operator<()

bool gnsstk::YDSTime::operator< ( const YDSTime right) const

Any (wildcard) type exception allowed, otherwise must be same time systems

Definition at line 229 of file YDSTime.cpp.

◆ operator<=()

bool gnsstk::YDSTime::operator<= ( const YDSTime right) const

Definition at line 268 of file YDSTime.cpp.

◆ operator=()

YDSTime & gnsstk::YDSTime::operator= ( const YDSTime right)

Assignment Operator.

Parameters
righta const reference to the YDSTime object to copy
Returns
a reference to this YDSTime

Definition at line 52 of file YDSTime.cpp.

◆ operator==()

bool gnsstk::YDSTime::operator== ( const YDSTime right) const

Any (wildcard) type exception allowed, otherwise must be same time systems

Definition at line 207 of file YDSTime.cpp.

◆ operator>()

bool gnsstk::YDSTime::operator> ( const YDSTime right) const

Definition at line 263 of file YDSTime.cpp.

◆ operator>=()

bool gnsstk::YDSTime::operator>= ( const YDSTime right) const

Definition at line 273 of file YDSTime.cpp.

◆ printError()

std::string gnsstk::YDSTime::printError ( const std::string &  fmt) const
virtual

This function works similarly to printf. Instead of filling the format with data, it fills with error messages.

Implements gnsstk::TimeTag.

Definition at line 113 of file YDSTime.cpp.

◆ printf()

std::string gnsstk::YDSTime::printf ( const std::string &  fmt) const
virtual

This function formats this time to a string. The exceptions thrown would only be due to problems parsing the fmt string.

Implements gnsstk::TimeTag.

Definition at line 88 of file YDSTime.cpp.

◆ reset()

void gnsstk::YDSTime::reset ( )
virtual

Reset this object to the default state.

Implements gnsstk::TimeTag.

Definition at line 200 of file YDSTime.cpp.

◆ setFromInfo()

bool gnsstk::YDSTime::setFromInfo ( const IdToValue info)
virtual

Set this object using the information provided in info.

Parameters
infothe 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 gnsstk::TimeTag.

Definition at line 138 of file YDSTime.cpp.

Member Data Documentation

◆ BEGIN_TIME

const YDSTime gnsstk::YDSTime::BEGIN_TIME
static

YDSTime constant corresponding to CommonTime::BEGINNING_OF_TIME

Definition at line 69 of file YDSTime.hpp.

◆ doy

int gnsstk::YDSTime::doy

Definition at line 185 of file YDSTime.hpp.

◆ sod

double gnsstk::YDSTime::sod

Definition at line 186 of file YDSTime.hpp.

◆ year

int gnsstk::YDSTime::year

Definition at line 184 of file YDSTime.hpp.


The documentation for this class was generated from the following files:


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:46