API Documentation
Loading...
Searching...
No Matches
TimeSpan Class Reference

Stores a time span, or difference between two times, with an optional start time. More...

#include <TimeSpan.h>

Collaboration diagram for TimeSpan:
[legend]

Public Member Functions

bool contains (const Time &time) const
 
sint08 elapsedDays () const
 
template<class t_type = fltp08>
constexpr t_type elapsedMilliseconds () const
 
constexpr fltp08 elapsedMinutes () const
 
sint08 elapsedMonths () const
 
constexpr sint08 elapsedNanoseconds () const
 
fltp08 elapsedPercent (Time time, bool clip_time) const
 
constexpr fltp08 elapsedSeconds () const
 
Time endTime () const
 
String getTimeString (const String &format_string) const
 
constexpr bool operator!= (const TimeSpan &time) const
 
constexpr TimeSpan operator* (const fltp08 &mult) const
 
constexpr TimeSpan operator* (const sint08 &mult) const
 
constexpr TimeSpanoperator*= (const fltp08 &mult)
 
constexpr TimeSpanoperator*= (const sint08 &mult)
 
constexpr TimeSpan operator+ (const TimeSpan &other) const
 
constexpr TimeSpanoperator+= (const TimeSpan &other)
 
constexpr TimeSpan operator- () const
 
constexpr TimeSpan operator- (const TimeSpan &other) const
 
constexpr TimeSpanoperator-= (const TimeSpan &other)
 
constexpr TimeSpan operator/ (const fltp08 &den) const
 
constexpr TimeSpan operator/ (const sint08 &den) const
 
constexpr fltp08 operator/ (const TimeSpan &time_2) const
 
constexpr bool operator< (const TimeSpan &other) const
 
constexpr bool operator<= (const TimeSpan &other) const
 
constexpr bool operator== (const TimeSpan &time) const
 
constexpr bool operator> (const TimeSpan &other) const
 
constexpr bool operator>= (const TimeSpan &other) const
 
constexpr void setEndTime (Time time)
 
constexpr void setStartTime (Time time)
 
constexpr Time startTime () const
 
constexpr TimeSpan ()
 
constexpr TimeSpan (const fltp08 elapsed_seconds)
 
constexpr TimeSpan (const sint08 elapsed_nano_seconds)
 
constexpr TimeSpan (const Time &start, const fltp08 &elapsed_seconds)
 
constexpr TimeSpan (const Time &start, const sint08 &elapsed_nano_seconds)
 
 TimeSpan (const Time &start, const Time &end)
 
constexpr TimeSpan (const uint08 elapsed_nano_seconds)
 
constexpr TimeSpan (sint04 elapsed_nano_seconds)
 
constexpr TimeSpan (uint04 elapsed_nano_seconds)
 

Protected Attributes

sint08 m_elapsed_time
 
Time m_start_time
 

Detailed Description

Stores a time span, or difference between two times, with an optional start time.


Note: timespans can be negative to represent times in the past from an optional start time or positive to represent a time in the future from a given start time.

Constructor & Destructor Documentation

◆ TimeSpan() [1/9]

TimeSpan ( )
inlineconstexpr

◆ TimeSpan() [2/9]

TimeSpan ( sint04 elapsed_nano_seconds)
inlineexplicitconstexpr

◆ TimeSpan() [3/9]

TimeSpan ( const sint08 elapsed_nano_seconds)
inlineexplicitconstexpr

◆ TimeSpan() [4/9]

TimeSpan ( uint04 elapsed_nano_seconds)
inlineexplicitconstexpr

◆ TimeSpan() [5/9]

TimeSpan ( const uint08 elapsed_nano_seconds)
inlineexplicitconstexpr

◆ TimeSpan() [6/9]

TimeSpan ( const fltp08 elapsed_seconds)
inlineexplicitconstexpr

◆ TimeSpan() [7/9]

TimeSpan ( const Time & start,
const Time & end )
inline

◆ TimeSpan() [8/9]

TimeSpan ( const Time & start,
const sint08 & elapsed_nano_seconds )
inlineconstexpr

◆ TimeSpan() [9/9]

TimeSpan ( const Time & start,
const fltp08 & elapsed_seconds )
inlineconstexpr

Member Function Documentation

◆ contains()

bool contains ( const Time & time) const

◆ elapsedDays()

sint08 elapsedDays ( ) const

◆ elapsedMilliseconds()

template<class t_type = fltp08>
t_type elapsedMilliseconds ( ) const
inlinenodiscardconstexpr

◆ elapsedMinutes()

fltp08 elapsedMinutes ( ) const
inlinenodiscardconstexpr

◆ elapsedMonths()

sint08 elapsedMonths ( ) const

◆ elapsedNanoseconds()

sint08 elapsedNanoseconds ( ) const
inlinenodiscardconstexpr

◆ elapsedPercent()

fltp08 elapsedPercent ( Time time,
bool clip_time ) const

◆ elapsedSeconds()

fltp08 elapsedSeconds ( ) const
inlinenodiscardconstexpr

◆ endTime()

Time endTime ( ) const
nodiscard

◆ getTimeString()

String getTimeString ( const String & format_string) const

◆ operator!=()

bool operator!= ( const TimeSpan & time) const
inlineconstexpr

◆ operator*() [1/2]

TimeSpan operator* ( const fltp08 & mult) const
inlineconstexpr

◆ operator*() [2/2]

TimeSpan operator* ( const sint08 & mult) const
inlineconstexpr

◆ operator*=() [1/2]

TimeSpan & operator*= ( const fltp08 & mult)
inlineconstexpr

◆ operator*=() [2/2]

TimeSpan & operator*= ( const sint08 & mult)
inlineconstexpr

◆ operator+()

TimeSpan operator+ ( const TimeSpan & other) const
inlineconstexpr

◆ operator+=()

TimeSpan & operator+= ( const TimeSpan & other)
inlineconstexpr

◆ operator-() [1/2]

TimeSpan operator- ( ) const
inlineconstexpr

◆ operator-() [2/2]

TimeSpan operator- ( const TimeSpan & other) const
inlineconstexpr

◆ operator-=()

TimeSpan & operator-= ( const TimeSpan & other)
inlineconstexpr

◆ operator/() [1/3]

TimeSpan operator/ ( const fltp08 & den) const
inlineconstexpr

◆ operator/() [2/3]

TimeSpan operator/ ( const sint08 & den) const
inlineconstexpr

◆ operator/() [3/3]

fltp08 operator/ ( const TimeSpan & time_2) const
inlineconstexpr

◆ operator<()

bool operator< ( const TimeSpan & other) const
inlineconstexpr

◆ operator<=()

bool operator<= ( const TimeSpan & other) const
inlineconstexpr

◆ operator==()

bool operator== ( const TimeSpan & time) const
inlineconstexpr

◆ operator>()

bool operator> ( const TimeSpan & other) const
inlineconstexpr

◆ operator>=()

bool operator>= ( const TimeSpan & other) const
inlineconstexpr

◆ setEndTime()

void setEndTime ( Time time)
inlineconstexpr

◆ setStartTime()

void setStartTime ( Time time)
inlineconstexpr

◆ startTime()

Time startTime ( ) const
inlinenodiscardconstexpr

Member Data Documentation

◆ m_elapsed_time

sint08 m_elapsed_time
protected

◆ m_start_time

Time m_start_time
protected

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