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 288 of file gdatetime.h.
using G::TimeInterval::s_type = unsigned int |
Definition at line 291 of file gdatetime.h.
using G::TimeInterval::us_type = unsigned int |
Definition at line 292 of file gdatetime.h.
|
explicit |
Constructor.
Definition at line 485 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 492 of file gdatetime.cpp.
Constructor. Overload for TimerTime.
Definition at line 502 of file gdatetime.cpp.
|
static |
Factory function for the maximum valid interval.
Definition at line 527 of file gdatetime.cpp.
bool G::TimeInterval::operator!= | ( | const TimeInterval & | other | ) | const |
Comparison operator.
Definition at line 553 of file gdatetime.cpp.
G::TimeInterval G::TimeInterval::operator+ | ( | const TimeInterval & | other | ) | const |
Returns the combined interval. Throws on overflow.
Definition at line 578 of file gdatetime.cpp.
void G::TimeInterval::operator+= | ( | TimeInterval | i | ) |
Adds the given interval. Throws on overflow.
Definition at line 601 of file gdatetime.cpp.
G::TimeInterval G::TimeInterval::operator- | ( | const TimeInterval & | other | ) | const |
Returns the interval difference. Throws on underflow.
Definition at line 585 of file gdatetime.cpp.
void G::TimeInterval::operator-= | ( | TimeInterval | i | ) |
Subtracts the given interval. Throws on underflow.
Definition at line 620 of file gdatetime.cpp.
bool G::TimeInterval::operator< | ( | const TimeInterval & | other | ) | const |
Comparison operator.
Definition at line 558 of file gdatetime.cpp.
bool G::TimeInterval::operator<= | ( | const TimeInterval & | other | ) | const |
Comparison operator.
Definition at line 563 of file gdatetime.cpp.
bool G::TimeInterval::operator== | ( | const TimeInterval & | other | ) | const |
Comparison operator.
Definition at line 548 of file gdatetime.cpp.
bool G::TimeInterval::operator> | ( | const TimeInterval & | other | ) | const |
Comparison operator.
Definition at line 568 of file gdatetime.cpp.
bool G::TimeInterval::operator>= | ( | const TimeInterval & | other | ) | const |
Comparison operator.
Definition at line 573 of file gdatetime.cpp.
G::TimeInterval::s_type G::TimeInterval::s | ( | ) | const |
Returns the number of seconds.
Definition at line 538 of file gdatetime.cpp.
void G::TimeInterval::streamOut | ( | std::ostream & | stream | ) | const |
Streams out the interval.
Definition at line 632 of file gdatetime.cpp.
G::TimeInterval::us_type G::TimeInterval::us | ( | ) | const |
Returns the fractional microseconds part.
Definition at line 543 of file gdatetime.cpp.
|
static |
Factory function for the zero interval.
Definition at line 533 of file gdatetime.cpp.