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
};
* 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:
Scalar mInterval;
unsigned mId;
- static Scalar nextFire_;
- static std::map<unsigned,Timer&> timers_;
+ static Scalar gNextFire;
+ static std::map<unsigned,Timer*> gTimers;
};