From 132c0c3cc3fd743943f8b076a122bb052aaf9635 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 10 Feb 2013 11:38:20 +0200 Subject: [PATCH] Move the time constants to timedelta.h --- source/time/timedelta.cpp | 9 +++++++++ source/time/timedelta.h | 11 +++++++++++ source/time/units.cpp | 17 ----------------- source/time/units.h | 15 +-------------- 4 files changed, 21 insertions(+), 31 deletions(-) delete mode 100644 source/time/units.cpp diff --git a/source/time/timedelta.cpp b/source/time/timedelta.cpp index 1bda9e5..a4e5db1 100644 --- a/source/time/timedelta.cpp +++ b/source/time/timedelta.cpp @@ -76,5 +76,14 @@ void operator<<(LexicalConverter &conv, const TimeDelta &td) conv.result(result); } +const TimeDelta zero(0); +const TimeDelta usec(1); +const TimeDelta msec(1000); +const TimeDelta sec(1000000); +const TimeDelta min(60*1000000); +const TimeDelta hour(3600*1000000LL); +const TimeDelta day(86400*1000000LL); +const TimeDelta week(7*86400*1000000LL); + } // namespace Time } // namespace Msp diff --git a/source/time/timedelta.h b/source/time/timedelta.h index 4a54118..9be491e 100644 --- a/source/time/timedelta.h +++ b/source/time/timedelta.h @@ -61,6 +61,17 @@ inline TimeDelta operator*(T a, const TimeDelta &t) { return t*a; } void operator<<(LexicalConverter &, const TimeDelta &); + +// Constants to be used in creation of TimeDeltas +extern const TimeDelta zero; +extern const TimeDelta usec; +extern const TimeDelta msec; +extern const TimeDelta sec; +extern const TimeDelta min; +extern const TimeDelta hour; +extern const TimeDelta day; +extern const TimeDelta week; + } // namespace Time } // namespace Msp diff --git a/source/time/units.cpp b/source/time/units.cpp deleted file mode 100644 index 382592c..0000000 --- a/source/time/units.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include "units.h" - -namespace Msp { -namespace Time { - -// Constants to be used in creation of TimeDeltas -const TimeDelta zero(0); -const TimeDelta usec(1); -const TimeDelta msec(1000); -const TimeDelta sec(1000000); -const TimeDelta min(60*1000000); -const TimeDelta hour(3600*1000000LL); -const TimeDelta day(86400*1000000LL); -const TimeDelta week(7*86400*1000000LL); - -} // namespace Time -} // namespace Msp diff --git a/source/time/units.h b/source/time/units.h index fb3be36..ec06c11 100644 --- a/source/time/units.h +++ b/source/time/units.h @@ -3,19 +3,6 @@ #include "timedelta.h" -namespace Msp { -namespace Time { - -extern const TimeDelta zero; -extern const TimeDelta usec; -extern const TimeDelta msec; -extern const TimeDelta sec; -extern const TimeDelta min; -extern const TimeDelta hour; -extern const TimeDelta day; -extern const TimeDelta week; - -} // namespace Time -} // namespace Msp +// This header is deprecated #endif -- 2.45.2