+#include <msp/time/utils.h>
#include "base.h"
#include "eventdispatcher.h"
#include "eventobject.h"
dispatch();
}
+void EventDispatcher::tick(const Time::Timer &timer)
+{
+ const Time::TimeStamp &timeout = timer.get_next_timeout();
+ if(timeout)
+ tick(timeout-Time::now());
+ else
+ tick();
+}
+
void EventDispatcher::object_events_changed(PollEvent ev, EventObject *obj)
{
poller.set_object(*obj, ev);
#include <sigc++/connection.h>
#include <sigc++/trackable.h>
#include <msp/time/timedelta.h>
+#include <msp/time/timer.h>
#include "poll.h"
namespace Msp {
waits at most the specified time before returning. */
void tick(const Time::TimeDelta &);
+ /** Checks for and dispatches events. If there are no events available,
+ waits until the timer's next timeout before returning. */
+ void tick(const Time::Timer &);
+
private:
void object_events_changed(PollEvent, EventObject *);
void object_deleted(EventObject *);