From: Mikko Rasa Date: Sun, 10 Feb 2013 09:38:20 +0000 (+0200) Subject: Move the time constants to timedelta.h X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=132c0c3cc3fd743943f8b076a122bb052aaf9635;p=libs%2Fcore.git Move the time constants to timedelta.h --- 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