Based on seal::TimeSpan.
More...
#include <GaudiKernel/Time.h>
List of all members.
Detailed Description
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.
- See also:
- Time.
(Documentation taken from original SEAL class)
- Author:
- Marco Clemencic
- Date:
- 2005-12-15
Definition at line 57 of file Time.h.
Member Typedef Documentation
| typedef longlong Gaudi::TimeSpan::ValueType |
Constructor & Destructor Documentation
| Gaudi::TimeSpan::TimeSpan |
( |
void |
) |
[inline] |
Initialize an empty (zero) time difference.
Definition at line 74 of file Time.icpp.
| Gaudi::TimeSpan::TimeSpan |
( |
Time |
t ) |
[inline] |
Initialize a time span from Time t.
Definition at line 77 of file Time.icpp.
| Gaudi::TimeSpan::TimeSpan |
( |
ValueType |
nsecs ) |
[inline] |
Initialize a time span to a specific length.
Definition at line 80 of file Time.icpp.
| Gaudi::TimeSpan::TimeSpan |
( |
ValueType |
secs, |
|
|
int |
nsecs |
|
) |
| [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.
- Parameters:
-
| secs | Seconds. |
| nsecs | Nanoseconds. |
Definition at line 90 of file Time.icpp.
: m_nsecs(secs * Time::SEC_NSECS + nsecs) {}
| Gaudi::TimeSpan::TimeSpan |
( |
int |
days, |
|
|
int |
hours, |
|
|
int |
mins, |
|
|
int |
secs, |
|
|
int |
nsecs |
|
) |
| [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.
- Parameters:
-
| days | Whole days. |
| hours | Whole hours. |
| mins | Whole minutes. |
| secs | Whole seconds. |
| nsecs | Nanoseconds. |
Definition at line 104 of file Time.icpp.
{
m_nsecs = (secs + 60 * (mins + 60 * (hours + 24*days)))*Time::SEC_NSECS + nsecs;
}
Member Function Documentation
| int Gaudi::TimeSpan::days |
( |
void |
) |
const [inline] |
Get the number of complete days in the span.
Definition at line 109 of file Time.icpp.
{
return int(m_nsecs / Time::SEC_NSECS / Time::SECS_PER_DAY);
}
| int Gaudi::TimeSpan::hours |
( |
void |
) |
const [inline] |
Get the number of complete hours in the span.
Definition at line 114 of file Time.icpp.
{
return int(m_nsecs / Time::SEC_NSECS / Time::SECS_PER_HOUR);
}
| int Gaudi::TimeSpan::lastHours |
( |
void |
) |
const [inline] |
Get the number of complete hours in the last incomplete day of the span.
Definition at line 135 of file Time.icpp.
| int Gaudi::TimeSpan::lastMinutes |
( |
void |
) |
const [inline] |
Get the number of complete minutes in the last incomplete hour of the span.
Definition at line 141 of file Time.icpp.
| int Gaudi::TimeSpan::lastNSeconds |
( |
void |
) |
const [inline] |
Get the number of nanoseconds in the last incomplete second of the span.
Definition at line 153 of file Time.icpp.
{
return int(m_nsecs % Time::SEC_NSECS);
}
| int Gaudi::TimeSpan::lastSeconds |
( |
void |
) |
const [inline] |
Get the number of complete seconds in the last incomplete minute of the span.
Definition at line 147 of file Time.icpp.
| int Gaudi::TimeSpan::minutes |
( |
void |
) |
const [inline] |
Get the number of complete minutes in the span.
Definition at line 119 of file Time.icpp.
{
return int(m_nsecs / Time::SEC_NSECS / 60);
}
Return the time span as nanoseconds.
Definition at line 129 of file Time.icpp.
Compute a modulo of a time span.
Definition at line 181 of file Time.icpp.
{
m_nsecs %= x.m_nsecs; return *this;
}
Multiply a time span.
Definition at line 170 of file Time.icpp.
{
m_nsecs *= x.m_nsecs;
return *this;
}
Add to a time span.
Definition at line 158 of file Time.icpp.
{
m_nsecs += x.m_nsecs;
return *this;
}
Subtract from a time span.
Definition at line 164 of file Time.icpp.
{
m_nsecs -= x.m_nsecs;
return *this;
}
Divide a time span.
Definition at line 176 of file Time.icpp.
{
m_nsecs /= x.m_nsecs; return *this;
}
Get the number of complete seconds in the span.
Definition at line 124 of file Time.icpp.
{
return m_nsecs / Time::SEC_NSECS;
}
Friends And Related Function Documentation
Member Data Documentation
The documentation for this class was generated from the following files:
- /afs/.cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v22r2/GaudiKernel/GaudiKernel/Time.h
- /afs/.cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v22r2/GaudiKernel/GaudiKernel/Time.icpp