X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FTimer.hh;h=246b4b1e0188974ea4dc3b600dd988a2d5bb95d1;hp=ed4e2f0bf3a1b59def8fabfb5d999dafee234e88;hb=3f6e44698c38b74bb622ad81ea9d2daa636981d2;hpb=a31d65a998121df0651c57bfb68782e2a07d2e2f diff --git a/src/Moof/Timer.hh b/src/Moof/Timer.hh index ed4e2f0..246b4b1 100644 --- a/src/Moof/Timer.hh +++ b/src/Moof/Timer.hh @@ -45,13 +45,15 @@ namespace Mf { -struct Timer +class Timer { +public: + enum Mode { INVALID = -1, NORMAL = 0, - ABSOLUTEE = 1, // the ABSOLUTE keyword isn't available on win32... + ACTUAL = 1, REPEAT = 2 }; @@ -100,14 +102,15 @@ struct Timer * sleep for the requested amount of time (and maybe longer). */ - static void sleep(Scalar seconds, bool absolute = false); + static void sleep(Scalar seconds, Mode mode = NORMAL); static Scalar getNextFire() { - return nextFire_; + return gNextFire; } + static void fireIfExpired(); static void fireIfExpired(Scalar t); private: @@ -121,8 +124,8 @@ private: Scalar mInterval; unsigned mId; - static Scalar nextFire_; - static std::map timers_; + static Scalar gNextFire; + static std::map gTimers; };