#include <boost/bind.hpp>
#include <boost/function.hpp>
+#include <boost/noncopyable.hpp>
#include <moof/hash.hh>
#include <moof/math.hh>
* runloop associated with the current running view will make an attempt to
* fire any expired timers as close to their scheduled times as possible.
*/
-class timer
+class timer : public boost::noncopyable
{
public:
*/
scalar seconds_remaining() const;
+ /**
+ * Get the absolute time of the next expiration of this timer.
+ * \return Seconds.
+ */
+ scalar next_expiration() const;
+
+
/**
* Get whether or not the timer is expired. A timer on a repeating
* schedule will never be expired since it will always have a scheduled
* Get the absolute time when the next timer is scheduled to expire.
* \return Absolute time, in seconds.
*/
- static scalar next_expiration()
+ static scalar next_event()
{
- return next_expiration_;
+ return next_event_;
}
private:
static unsigned new_identifier();
- static scalar find_next_expiration();
+ static scalar find_next_event();
function function_;
mode mode_;
scalar interval_;
unsigned id_;
- static scalar next_expiration_;
+ static scalar next_event_;
static hash<unsigned,timer*,hash_function> timers_;
};