]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Timer.hh
cade lab fixes
[chaz/yoink] / src / Moof / Timer.hh
index 6c1af5615a6426913eac86788a46b9e02116bbd4..246b4b1e0188974ea4dc3b600dd988a2d5bb95d1 100644 (file)
 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,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:
@@ -115,14 +118,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<unsigned,Timer&>        timers_;
+       static Scalar                                           gNextFire;
+       static std::map<unsigned,Timer*>        gTimers;
 };
 
 
This page took 0.019053 seconds and 4 git commands to generate.