X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Feventdispatcher.h;h=8142b080e2bec9140ddccc1be51ba5f70222fc7c;hb=e0ebde8e33b1915860e6d253f5cefb33a8cd6ee0;hp=9bea6d2140943f014857a7bd1ee5d629add232e7;hpb=c0861d1f8e3869f058bc8b152cd35a08e5b03e73;p=libs%2Fcore.git diff --git a/source/eventdispatcher.h b/source/eventdispatcher.h index 9bea6d2..8142b08 100644 --- a/source/eventdispatcher.h +++ b/source/eventdispatcher.h @@ -8,6 +8,7 @@ Distributed under the LGPL #define EVENTDISPATCHER_H_ #include +#include #include "poll.h" namespace Msp { @@ -17,7 +18,7 @@ namespace IO { Put your I/O objects inside one of these to get signaled when something happens on some of them. */ -class EventDispatcher +class EventDispatcher: public sigc::trackable { public: EventDispatcher(); @@ -25,10 +26,16 @@ public: void remove(Base &); /** - Checks for and dispatches events. If block is true, will block until events - are available. + Checks for and dispatches events. If there are no events available, blocks + until there are. */ - void tick(bool =true); + void tick(); + + /** + Checks for and dispatches events. If there are no events available, waits + at most the specified time before returning. + */ + void tick(const Time::TimeDelta &); private: struct Slot { @@ -45,6 +52,7 @@ private: void object_events_changed(PollEvent, Base *); void object_deleted(Base *); + void dispatch(); }; } // namespace IO