Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
gnsstk::TimeRange Class Reference

Detailed Description

Definition at line 59 of file TimeRange.hpp.

#include <TimeRange.hpp>

Public Types

typedef std::pair< CommonTime, CommonTimeDTPair
 

Public Member Functions

std::string dump (const std::string formatArg="%02m/%02d/%02y %02H:%02M:%02S") const
 Dump method. More...
 
CommonTime getEnd () const
 
CommonTime getStart () const
 
bool inRange (const CommonTime &testDT) const
 
bool isAfter (const TimeRange &right) const
 
bool isPriorTo (const TimeRange &right) const
 
bool isSubsetOf (const TimeRange &right) const
 
 NEW_EXCEPTION_CLASS (TimeRangeException, Exception)
 
bool operator< (const TimeRange &right) const
 
bool operator== (const TimeRange &right) const
 Equivalence means all members are identical. More...
 
bool overlaps (const TimeRange &right) const
 
std::string printf (const std::string formatArg="%02m/%02d/%02y %02H:%02M:%02S") const
 
void set (const CommonTime &startDT, const CommonTime &endDT, const bool startInclusive=true, const bool endInclusive=true)
 
TimeRangesetToString (const std::string &str, const std::string &fmt)
 
 TimeRange ()
 
 TimeRange (const CommonTime &startDT, const CommonTime &endDT, const bool startInclusive=true, const bool endInclusive=true)
 
 TimeRange (const TimeRange &tr)
 Copy construtor. More...
 
 TimeRange (DTPair dtPair, const bool startInclusive=true, const bool endInclusive=true)
 
 ~TimeRange ()
 

Protected Member Functions

void init (const CommonTime &startDT, const CommonTime &endDT, const bool startInclusive=true, const bool endInclusive=true)
 

Protected Attributes

CommonTime end
 
bool includeEndTime
 
bool includeStartTime
 
CommonTime start
 

Member Typedef Documentation

◆ DTPair

Definition at line 65 of file TimeRange.hpp.

Constructor & Destructor Documentation

◆ TimeRange() [1/4]

gnsstk::TimeRange::TimeRange ( )

Definition at line 50 of file TimeRange.cpp.

◆ TimeRange() [2/4]

gnsstk::TimeRange::TimeRange ( const CommonTime startDT,
const CommonTime endDT,
const bool  startInclusive = true,
const bool  endInclusive = true 
)
Exceptions
TimeRangeException

Definition at line 57 of file TimeRange.cpp.

◆ TimeRange() [3/4]

gnsstk::TimeRange::TimeRange ( DTPair  dtPair,
const bool  startInclusive = true,
const bool  endInclusive = true 
)

To cover potential use with RiseSetTimeList

Exceptions
TimeRangeException

Definition at line 74 of file TimeRange.cpp.

◆ TimeRange() [4/4]

gnsstk::TimeRange::TimeRange ( const TimeRange tr)

Copy construtor.

Definition at line 137 of file TimeRange.cpp.

◆ ~TimeRange()

gnsstk::TimeRange::~TimeRange ( )
inline

Definition at line 87 of file TimeRange.hpp.

Member Function Documentation

◆ dump()

std::string gnsstk::TimeRange::dump ( const std::string  formatArg = "%02m/%02d/%02y %02H:%02M:%02S") const

Dump method.

Definition at line 394 of file TimeRange.cpp.

◆ getEnd()

CommonTime gnsstk::TimeRange::getEnd ( ) const
inline

Definition at line 91 of file TimeRange.hpp.

◆ getStart()

CommonTime gnsstk::TimeRange::getStart ( ) const
inline

Definition at line 90 of file TimeRange.hpp.

◆ init()

void gnsstk::TimeRange::init ( const CommonTime startDT,
const CommonTime endDT,
const bool  startInclusive = true,
const bool  endInclusive = true 
)
protected
Exceptions
TimeRangeException

Definition at line 93 of file TimeRange.cpp.

◆ inRange()

bool gnsstk::TimeRange::inRange ( const CommonTime testDT) const

Return true is testDT is within the TimeRange. Whether the boundaries are included is in accordance with the indications provided in includeStartTime and includeEndTime.

Definition at line 146 of file TimeRange.cpp.

◆ isAfter()

bool gnsstk::TimeRange::isAfter ( const TimeRange right) const

True if start/end of this object are both after the end of "right"

Definition at line 258 of file TimeRange.cpp.

◆ isPriorTo()

bool gnsstk::TimeRange::isPriorTo ( const TimeRange right) const

True if start/end of this object are both prior to start of "right"

Definition at line 204 of file TimeRange.cpp.

◆ isSubsetOf()

bool gnsstk::TimeRange::isSubsetOf ( const TimeRange right) const
Returns
true if this.start >= right.start and this.end <= right.end

Definition at line 249 of file TimeRange.cpp.

◆ NEW_EXCEPTION_CLASS()

gnsstk::TimeRange::NEW_EXCEPTION_CLASS ( TimeRangeException  ,
Exception   
)

◆ operator<()

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

Included to enable use in maps/sets. This operator returns true if the start time of left is less than start time of right, regardless of end time.

Definition at line 175 of file TimeRange.cpp.

◆ operator==()

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

Equivalence means all members are identical.

Definition at line 166 of file TimeRange.cpp.

◆ overlaps()

bool gnsstk::TimeRange::overlaps ( const TimeRange right) const
Returns
true if this.start < right.end and this.end > right.start

Definition at line 221 of file TimeRange.cpp.

◆ printf()

std::string gnsstk::TimeRange::printf ( const std::string  formatArg = "%02m/%02d/%02y %02H:%02M:%02S") const

Formatted print

Exceptions
StringUtils::StringException

Definition at line 376 of file TimeRange.cpp.

◆ set()

void gnsstk::TimeRange::set ( const CommonTime startDT,
const CommonTime endDT,
const bool  startInclusive = true,
const bool  endInclusive = true 
)
Exceptions
TimeRangeException

Definition at line 120 of file TimeRange.cpp.

◆ setToString()

TimeRange & gnsstk::TimeRange::setToString ( const std::string &  str,
const std::string &  fmt 
)

Formatted string input. Assume string has

  • possible white space followed by
  • optional '[' or '(' (assume '['),
  • followed by a valid CommonTime string corresponding to fmt,
  • followed by a ','
  • followed by a valid CommonTime string corresponding to fmt,
  • followed by an optional ']' or ')' (assume ']').
    Exceptions
    TimeRangeException
    StringUtils::StringException

std::cout << "secondTime: '" << secondTime << "'" << endl;

Definition at line 274 of file TimeRange.cpp.

Member Data Documentation

◆ end

CommonTime gnsstk::TimeRange::end
protected

Definition at line 157 of file TimeRange.hpp.

◆ includeEndTime

bool gnsstk::TimeRange::includeEndTime
protected

Definition at line 159 of file TimeRange.hpp.

◆ includeStartTime

bool gnsstk::TimeRange::includeStartTime
protected

Definition at line 158 of file TimeRange.hpp.

◆ start

CommonTime gnsstk::TimeRange::start
protected

Definition at line 156 of file TimeRange.hpp.


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


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