E-MailRelay
|
An interval between two G::SystemTime values or two G::TimerTime values. More...
#include <gdatetime.h>
Public Types | |
using | s_type = unsigned int |
using | us_type = unsigned int |
Public Member Functions | |
TimeInterval (unsigned int s, unsigned int us=0U) | |
Constructor. More... | |
TimeInterval (const SystemTime &start, const SystemTime &end) | |
Constructor. More... | |
TimeInterval (const TimerTime &start, const TimerTime &end) | |
Constructor. Overload for TimerTime. More... | |
unsigned int | s () const |
Returns the number of seconds. More... | |
unsigned int | us () const |
Returns the fractional microseconds part. More... | |
void | streamOut (std::ostream &) const |
Streams out the interval. More... | |
bool | operator< (const TimeInterval &) const |
Comparison operator. More... | |
bool | operator<= (const TimeInterval &) const |
Comparison operator. More... | |
bool | operator== (const TimeInterval &) const |
Comparison operator. More... | |
bool | operator!= (const TimeInterval &) const |
Comparison operator. More... | |
bool | operator> (const TimeInterval &) const |
Comparison operator. More... | |
bool | operator>= (const TimeInterval &) const |
Comparison operator. More... | |
TimeInterval | operator+ (const TimeInterval &) const |
Returns the combined interval. Throws on overflow. More... | |
TimeInterval | operator- (const TimeInterval &) const |
Returns the interval difference. Throws on underflow. More... | |
void | operator+= (TimeInterval) |
Adds the given interval. Throws on overflow. More... | |
void | operator-= (TimeInterval) |
Subtracts the given interval. Throws on underflow. More... | |
Static Public Member Functions | |
static TimeInterval | zero () |
Factory function for the zero interval. More... | |
static TimeInterval | limit () |
Factory function for the maximum valid interval. More... | |
An interval between two G::SystemTime values or two G::TimerTime values.
Definition at line 304 of file gdatetime.h.
using G::TimeInterval::s_type = unsigned int |
Definition at line 307 of file gdatetime.h.
using G::TimeInterval::us_type = unsigned int |
Definition at line 308 of file gdatetime.h.
|
explicit |
Constructor.
Definition at line 594 of file gdatetime.cpp.
G::TimeInterval::TimeInterval | ( | const SystemTime & | start, |
const SystemTime & | end | ||
) |
Constructor.
Constructs a zero interval if 'end' is before 'start', and the limit() interval if 'end' is too far ahead of 'start' for the underlying type.
Definition at line 602 of file gdatetime.cpp.
Constructor. Overload for TimerTime.
Definition at line 613 of file gdatetime.cpp.
|
static |
Factory function for the maximum valid interval.
Definition at line 638 of file gdatetime.cpp.
bool G::TimeInterval::operator!= | ( | const TimeInterval & | other | ) | const |
Comparison operator.
Definition at line 665 of file gdatetime.cpp.
G::TimeInterval G::TimeInterval::operator+ | ( | const TimeInterval & | other | ) | const |
Returns the combined interval. Throws on overflow.
Definition at line 696 of file gdatetime.cpp.
void G::TimeInterval::operator+= | ( | TimeInterval | i | ) |
Adds the given interval. Throws on overflow.
Definition at line 722 of file gdatetime.cpp.
G::TimeInterval G::TimeInterval::operator- | ( | const TimeInterval & | other | ) | const |
Returns the interval difference. Throws on underflow.
Definition at line 705 of file gdatetime.cpp.
void G::TimeInterval::operator-= | ( | TimeInterval | i | ) |
Subtracts the given interval. Throws on underflow.
Definition at line 741 of file gdatetime.cpp.
bool G::TimeInterval::operator< | ( | const TimeInterval & | other | ) | const |
Comparison operator.
Definition at line 671 of file gdatetime.cpp.
bool G::TimeInterval::operator<= | ( | const TimeInterval & | other | ) | const |
Comparison operator.
Definition at line 677 of file gdatetime.cpp.
bool G::TimeInterval::operator== | ( | const TimeInterval & | other | ) | const |
Comparison operator.
Definition at line 659 of file gdatetime.cpp.
bool G::TimeInterval::operator> | ( | const TimeInterval & | other | ) | const |
Comparison operator.
Definition at line 683 of file gdatetime.cpp.
bool G::TimeInterval::operator>= | ( | const TimeInterval & | other | ) | const |
Comparison operator.
Definition at line 689 of file gdatetime.cpp.
G::TimeInterval::s_type G::TimeInterval::s | ( | ) | const |
Returns the number of seconds.
Definition at line 649 of file gdatetime.cpp.
void G::TimeInterval::streamOut | ( | std::ostream & | stream | ) | const |
Streams out the interval.
Definition at line 753 of file gdatetime.cpp.
G::TimeInterval::us_type G::TimeInterval::us | ( | ) | const |
Returns the fractional microseconds part.
Definition at line 654 of file gdatetime.cpp.
|
static |
Factory function for the zero interval.
Definition at line 644 of file gdatetime.cpp.