1 #ifndef GAUDIKERNEL_TIME_ICPP 2 #define GAUDIKERNEL_TIME_ICPP 1 54 return ( (
year % 4 ) == 0 && ( (
year % 100 ) != 0 || (
year % 400 ) == 0 ) );
int year(bool local) const
Get the year.
Time()=default
Initialize an empty (zero) time value.
int lastSeconds() const
Get the number of complete seconds in the last incomplete minute of the span.
static const int SECS_PER_HOUR
Seconds in one hour hour.
static Time max()
Returns the maximum time.
bool operator!(const Gaudi::Time &t)
TimeSpan & operator/=(const TimeSpan &n)
Divide a time span.
The stream buffer is a small object collecting object data.
Gaudi::Time operator+(const Gaudi::Time &t, const Gaudi::TimeSpan &ts)
ValueType seconds() const
Get the number of complete seconds in the span.
Gaudi::TimeSpan operator-(const Gaudi::Time &t1, const Gaudi::Time &t2)
TimeSpan()=default
Initialize an empty (zero) time difference.
TimeSpan & operator+=(const TimeSpan &x)
Add to a time span.
static const ValueType SEC_NSECS
Nanoseconds in one second.
int days() const
Get the number of complete days in the span.
TimeSpan & operator-=(const TimeSpan &x)
Subtract from a time span.
int lastHours() const
Get the number of complete hours in the last incomplete day of the span.
bool operator<(backwards_compatibility_hack_time_timespan, backwards_compatibility_hack_time_timespan)
int minutes() const
Get the number of complete minutes in the span.
ValueType ns() const
Return the time as nanoseconds since 00:00:00 on January 1, 1970 in UTC.
int hours() const
Get the number of complete hours in the span.
TimeSpan & operator%=(const TimeSpan &n)
Compute a modulo of a time span.
Time & operator+=(const TimeSpan &x)
Add the specified amount to the time.
static bool isLeap(int year)
Check if the year is a leap-year.
int lastMinutes() const
Get the number of complete minutes in the last incomplete hour of the span.
static const int SECS_PER_DAY
Seconds in 24 hours.
backwards_compatibility_hack_time_timespan()=delete
ValueType ns() const
Return the time span as nanoseconds.
static Time epoch()
Returns the minimum time.
TimeSpan & operator *=(const TimeSpan &n)
Multiply a time span.
StreamBuffer & operator>>(StreamBuffer &s, Gaudi::Time &t)
StreamBuffer & operator<<(StreamBuffer &s, const Gaudi::Time &t)
Time & operator-=(const TimeSpan &x)
Subtract the specified amount from the time.
Header file for std:chrono::duration-based Counters.
int lastNSeconds() const
Get the number of nanoseconds in the last incomplete second of the span.
void TimeAssert(bool cond, const std::string &msg="time assertion failed") const
std::string nanoformat(size_t minwidth=1, size_t maxwidth=9) const
Format the nanosecond fractional part of the time as a string.
std::ostream & operator<<(std::ostream &o, const Gaudi::StringKey &key)
printout of the object reply on the native printout for the string