X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fio%2Feventdispatcher.cpp;h=cf37c1e7e1fbd81155608895bd14ebe9bd882e10;hp=8660b5b29562029daef671c892a325db51dcd783;hb=7ca970e5db84020e4735afccf43ede4d52ac0bf0;hpb=c21ab7e49852585df01b4cc19599e25a918b581b diff --git a/source/io/eventdispatcher.cpp b/source/io/eventdispatcher.cpp index 8660b5b..cf37c1e 100644 --- a/source/io/eventdispatcher.cpp +++ b/source/io/eventdispatcher.cpp @@ -1,4 +1,4 @@ -#include +#include #include "base.h" #include "eventdispatcher.h" #include "eventobject.h" @@ -10,6 +10,9 @@ namespace IO { EventDispatcher::EventDispatcher() { } +EventDispatcher::~EventDispatcher() +{ } + void EventDispatcher::add(EventObject &obj) { SlotMap::iterator i = objects.find(&obj); @@ -55,6 +58,15 @@ void EventDispatcher::tick(const Time::TimeDelta &dt) 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);