]> Dogcows Code - chaz/yoink/blobdiff - src/moof/timer.hh
the massive refactoring effort
[chaz/yoink] / src / moof / timer.hh
similarity index 55%
rename from src/Moof/Timer.hh
rename to src/moof/timer.hh
index 4cc848048c5655d38aabe2e89b47d9a9bc9669e4..d7a411bc48e82089891795db5602d2cfb42e4326 100644 (file)
@@ -13,7 +13,7 @@
 #define _MOOF_TIMER_HH_
 
 /**
- * @file Timer.hh
+ * \file timer.hh
  * Functions for measuring time in a friendly unit.
  */
 
 #include <boost/bind.hpp>
 #include <boost/function.hpp>
 
-#include <Moof/Math.hh>
+#include <moof/math.hh>
 
 
-namespace Mf {
+namespace moof {
 
 
-class Timer
+class timer
 {
 public:
 
-       enum Mode
+       enum mode
        {
-               INVALID         = -1,
-               NORMAL          =  0,
-               ACTUAL          =  1,
-               REPEAT          =  2
+               invalid         = -1,
+               normal          =  0,
+               absolute        =  1,
+               repeat          =  2
        };
 
-       typedef boost::function<void(Timer&,Scalar)> Function;
+       typedef boost::function<void(timer&,scalar)> function;
 
 
-       Timer() :
-               mMode(INVALID) {}
+       timer() :
+               mode_(invalid) {}
 
-       Timer(const Function& function, Scalar seconds, Mode mode = NORMAL)
+       timer(const function& function, scalar seconds, mode mode = normal)
        {
                init(function, seconds, mode);
        }
 
-       ~Timer()
+       ~timer()
        {
                invalidate();
        }
 
-       void init(const Function& function, Scalar seconds,
-                         Mode mode = NORMAL);
+       void init(const function& function, scalar seconds, mode mode = normal);
 
-       bool isValid() const;
+       bool is_valid() const;
        void invalidate();
 
        void fire();
 
-       Scalar getSecondsRemaining() const;
-       bool isExpired() const;
-       bool isRepeating() const;
+       scalar seconds_remaining() const;
+       bool is_expired() const;
+       bool is_repeating() const;
 
 
        /**
         * Get the number of seconds since a fixed, arbitrary point in the
         * past.
-        * @return Seconds.
+        * \return Seconds.
         */
-
-       static Scalar getTicks();
+       static scalar ticks();
 
 
        /**
@@ -86,36 +84,38 @@ public:
         * sleep if sleep was interrupted by a signal.  Therefore, calling this
         * function is guaranteed to sleep for the requested amount of time
         * (and maybe longer).
+        * \param seconds Number of seconds.
+        * \param mode The timer mode.
         */
-
-       static void sleep(Scalar seconds, Mode mode = NORMAL);
+       static void sleep(scalar seconds, mode mode = normal);
 
 
-       static Scalar getNextFire()
+       static scalar next_expiration()
        {
                return gNextFire;
        }
 
-       static void fireIfExpired();
-       static void fireIfExpired(Scalar t);
+       static void fire_expired_timers();
+       static void fire_expired_timers(scalar t);
+
 
 private:
 
-       static unsigned getNewID();
-       static Scalar findNextFire();
+       static unsigned new_identifier();
+       static scalar find_next_expiration();
 
-       Function        mFunction;
-       Mode            mMode;
-       Scalar          mAbsolute;
-       Scalar          mInterval;
-       unsigned        mId;
+       function        function_;
+       mode            mode_;
+       scalar          absolute_;
+       scalar          interval_;
+       unsigned        id_;
 
-       static Scalar                                           gNextFire;
-       static std::map<unsigned,Timer*>        gTimers;
+       static scalar                                           gNextFire;
+       static std::map<unsigned,timer*>        gTimers;
 };
 
 
-} // namespace Mf
+} // namespace moof
 
 #endif // _MOOF_TIMER_HH_
 
This page took 0.024451 seconds and 4 git commands to generate.