The Gaudi Framework
v30r3 (a5ef0a68)
|
Based on seal::TimeSpan. More...
#include <GaudiKernel/Time.h>
Public Types | |
typedef longlong | ValueType |
Public Member Functions | |
TimeSpan ()=default | |
Initialize an empty (zero) time difference. More... | |
TimeSpan (Time t) | |
Initialize a time span from Time t. More... | |
TimeSpan (ValueType nsecs) | |
Initialize a time span to a specific length. More... | |
TimeSpan (ValueType secs, int nsecs) | |
Initialise a time span to a specific length. More... | |
TimeSpan (int days, int hours, int mins, int secs, int nsecs) | |
Initialise a time span to a specific length. More... | |
int | days () const |
Get the number of complete days in the span. More... | |
int | hours () const |
Get the number of complete hours in the span. More... | |
int | minutes () const |
Get the number of complete minutes in the span. More... | |
ValueType | seconds () const |
Get the number of complete seconds in the span. More... | |
int | lastHours () const |
Get the number of complete hours in the last incomplete day of the span. More... | |
int | lastMinutes () const |
Get the number of complete minutes in the last incomplete hour of the span. More... | |
int | lastSeconds () const |
Get the number of complete seconds in the last incomplete minute of the span. More... | |
int | lastNSeconds () const |
Get the number of nanoseconds in the last incomplete second of the span. More... | |
TimeSpan & | operator+= (const TimeSpan &x) |
Add to a time span. More... | |
TimeSpan & | operator-= (const TimeSpan &x) |
Subtract from a time span. More... | |
TimeSpan & | operator*= (const TimeSpan &n) |
Multiply a time span. More... | |
TimeSpan & | operator/= (const TimeSpan &n) |
Divide a time span. More... | |
TimeSpan & | operator%= (const TimeSpan &n) |
Compute a modulo of a time span. More... | |
ValueType | ns () const |
Return the time span as nanoseconds. More... | |
Private Attributes | |
ValueType | m_nsecs = 0 |
Friends | |
class | Time |
bool | operator== (const Gaudi::TimeSpan &t1, const Gaudi::TimeSpan &t2) |
bool | operator!= (const Gaudi::TimeSpan &t1, const Gaudi::TimeSpan &t2) |
bool | operator< (const Gaudi::TimeSpan &t1, const Gaudi::TimeSpan &t2) |
bool | operator<= (const Gaudi::TimeSpan &t1, const Gaudi::TimeSpan &t2) |
bool | operator> (const Gaudi::TimeSpan &t1, const Gaudi::TimeSpan &t2) |
bool | operator>= (const Gaudi::TimeSpan &t1, const Gaudi::TimeSpan &t2) |
Gaudi::TimeSpan | operator+ (const Gaudi::TimeSpan &ts1, const Gaudi::TimeSpan &ts2) |
Gaudi::TimeSpan | operator- (const Gaudi::TimeSpan &ts1, const Gaudi::TimeSpan &ts2) |
Based on seal::TimeSpan.
A difference between two Time values. In addition to supporting normal integer artihmetic and comparisons, the span can also be converted to a number useful units.
(Documentation taken from original SEAL class)
|
default |
Initialize an empty (zero) time difference.
|
inline |
|
inline |
|
inline |
Initialise a time span to a specific length.
The value is initialised to the sum of the parts—the parts do not need to fall into their "natural" ranges. The values are normalised to the natural meanings (e.g. 1000 seconds - 500 nanoseconds), so be careful with signs if you are producing values from other sources.
secs | Seconds. |
nsecs | Nanoseconds. |
Definition at line 82 of file Time.icpp.
|
inline |
Initialise a time span to a specific length.
The value is initialised to the sum of the parts—the parts do not need to fall into their "natural" ranges. The values are normalised to the natural meanings (e.g. 1000 seconds - 500 nanoseconds), so be careful with signs if you are producing values from other sources.
days | Whole days. |
hours | Whole hours. |
mins | Whole minutes. |
secs | Whole seconds. |
nsecs | Nanoseconds. |
Definition at line 95 of file Time.icpp.
|
inline |
Get the number of complete days in the span.
Definition at line 101 of file Time.icpp.
|
inline |
Get the number of complete hours in the span.
Definition at line 104 of file Time.icpp.
|
inline |
Get the number of complete hours in the last incomplete day of the span.
Definition at line 117 of file Time.icpp.
|
inline |
Get the number of complete minutes in the last incomplete hour of the span.
Definition at line 121 of file Time.icpp.
|
inline |
Get the number of nanoseconds in the last incomplete second of the span.
Definition at line 129 of file Time.icpp.
|
inline |
Get the number of complete seconds in the last incomplete minute of the span.
Definition at line 125 of file Time.icpp.
|
inline |
Get the number of complete minutes in the span.
Definition at line 107 of file Time.icpp.
|
inline |
|
inline |
Get the number of complete seconds in the span.
Definition at line 110 of file Time.icpp.
|
friend |
Definition at line 90 of file Time.h.
|
friend |
Definition at line 100 of file Time.h.
|
friend |
Definition at line 105 of file Time.h.
|
friend |
Definition at line 92 of file Time.h.
|
friend |
Definition at line 94 of file Time.h.
|
friend |
Definition at line 88 of file Time.h.
|
friend |
Definition at line 96 of file Time.h.
|
friend |
Definition at line 98 of file Time.h.