X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FTimer.hh;h=b657a5f9632aee158d8b8d5ef4e72d9178979369;hp=6c1af5615a6426913eac86788a46b9e02116bbd4;hb=71bd9dbaf1c1e3c55a9f63392a73865d8aeee7d4;hpb=33842c860fe18ca8cf087905992885687434320c diff --git a/src/Moof/Timer.hh b/src/Moof/Timer.hh index 6c1af56..b657a5f 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 }; @@ -59,7 +61,7 @@ struct Timer Timer() : - mode_(INVALID) {} + mMode(INVALID) {} Timer(const Function& function, Scalar seconds, Mode mode = NORMAL) { @@ -100,12 +102,12 @@ 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(Scalar t); @@ -115,14 +117,14 @@ private: static unsigned getNewID(); static Scalar findNextFire(); - Function function_; - Mode mode_; - Scalar absolute_; - Scalar interval_; - unsigned id_; + Function mFunction; + Mode mMode; + Scalar mAbsolute; + Scalar mInterval; + unsigned mId; - static Scalar nextFire_; - static std::map timers_; + static Scalar gNextFire; + static std::map gTimers; };