-#include <msp/time/units.h>
+#include <msp/time/utils.h>
#include "base.h"
#include "eventdispatcher.h"
#include "eventobject.h"
EventDispatcher::EventDispatcher()
{ }
+EventDispatcher::~EventDispatcher()
+{ }
+
void EventDispatcher::add(EventObject &obj)
{
SlotMap::iterator i = objects.find(&obj);
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);