1 #ifndef GAUDIKERNEL_TIME_H 2 #define GAUDIKERNEL_TIME_H 1 30 typedef struct _FILETIME FILETIME;
64 TimeSpan(
int days,
int hours,
int mins,
int secs,
int nsecs);
69 ValueType seconds()
const;
71 int lastHours()
const;
72 int lastMinutes()
const;
73 int lastSeconds()
const;
74 int lastNSeconds()
const;
85 {
return t1.
ns() == t2.
ns(); }
88 {
return t1.
ns() != t2.
ns(); }
91 {
return t1.
ns() < t2.
ns(); }
94 {
return t1.
ns() <= t2.
ns(); }
97 {
return t1.
ns() > t2.
ns(); }
100 {
return t1.
ns() >= t2.
ns(); }
109 ValueType m_nsecs = 0;
258 static const int SECS_PER_DAY = 86400;
261 static const int SECS_PER_HOUR = 3600;
264 static const ValueType SEC_NSECS = 1000000000;
270 Time(ValueType nsecs);
271 Time(ValueType secs,
int nsecs);
272 Time(
int year,
int month,
int day,
int hour,
int min,
int sec,
273 ValueType nsecs,
bool local =
true);
283 static Time current();
285 static Time from (
const FILETIME *systime);
287 static Time build (
bool local,
const tm &base,
TimeSpan diff = 0);
289 tm split (
bool local,
int *nsecpart = 0)
const;
290 tm utc (
int *nsecpart = 0)
const;
291 tm local (
int *nsecpart = 0)
const;
293 int year (
bool local)
const;
294 int month (
bool local)
const;
295 int day (
bool local)
const;
296 int hour (
bool local)
const;
297 int minute (
bool local)
const;
298 int second (
bool local)
const;
299 int nsecond ()
const;
300 int weekday (
bool local)
const;
301 bool isdst (
bool local)
const;
303 ValueType utcoffset (
int *daylight = 0)
const;
304 const char * timezone (
int *daylight = 0)
const;
309 ValueType
ns()
const;
312 std::string nanoformat (
size_t minwidth = 1,
size_t maxwidth = 9)
const;
314 static bool isLeap (
int year);
317 static unsigned toDosDate (
Time time);
318 static Time fromDosDate (
unsigned dosDate);
321 {
return t1.
ns() == t2.
ns(); }
324 {
return t1.
ns() != t2.
ns(); }
327 {
return t1.
ns() < t2.
ns(); }
330 {
return t1.
ns() <= t2.
ns(); }
333 {
return t1.
ns() > t2.
ns(); }
336 {
return t1.
ns() >= t2.
ns(); }
339 ValueType m_nsecs = 0;
351 #endif // GAUDIKERNEL_TIME_H
bool operator!=(const GaudiUtils::Allocator< T1 > &, const GaudiUtils::Allocator< T2 > &)
Define general base for Gaudi exception.
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
void TimeAssert(bool cond, const std::string &msg="time assertion failed") const
bool operator>(const EventIDBase &lhs, const EventIDBase &rhs)
Months
Symbolic names for months.
ValueType ns() const
Return the time span as nanoseconds.
bool operator==(const GaudiUtils::Allocator< T1 > &, const GaudiUtils::Allocator< T2 > &)
This class is used for returning status codes from appropriate routines.
Exception thrown by Gaudi::Time.
bool operator<(const EventIDBase &lhs, const EventIDBase &rhs)
TimeException(std::string Message="unspecified exception", std::string Tag="*Gaudi::Time*", StatusCode Code=StatusCode::FAILURE)
bool operator>=(const EventIDBase &lhs, const EventIDBase &rhs)
GAUDI_API Stat operator-(const Stat &stat, const double value)
external operator for subtraction of Stat and a number
ValueType ns() const
Return the time as nanoseconds since 00:00:00 on January 1, 1970 in UTC.
Helper functions to set/get the application return code.
bool operator<=(const EventIDBase &lhs, const EventIDBase &rhs)
decltype(std::declval< TP >()+std::declval< T >()) operator+(const T &v, const Property< TP, V, H > &p)
implemantation of (value + property)