X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Feventdispatcher.h;fp=source%2Feventdispatcher.h;h=0000000000000000000000000000000000000000;hp=7e89d4739e845f0e0c180845ffedb43184eefd9f;hb=6e0fd758970bcb5bad5e3f2454b694cc4d7b4b66;hpb=b97d4e9f86e90254ab9edef7ee62a910f6333c78 diff --git a/source/eventdispatcher.h b/source/eventdispatcher.h deleted file mode 100644 index 7e89d47..0000000 --- a/source/eventdispatcher.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef EVENTDISPATCHER_H_ -#define EVENTDISPATCHER_H_ - -#include -#include -#include "poll.h" - -namespace Msp { -namespace IO { - -/** -Put your I/O objects inside one of these to get signaled when something happens -on some of them. -*/ -class EventDispatcher: public sigc::trackable -{ -private: - struct Slot - { - Base *obj; - sigc::connection evch_conn; - sigc::connection del_conn; - - Slot(Base *o): obj(o) { } - }; - - typedef std::map SlotMap; - - Poller poller; - SlotMap objects; - -public: - EventDispatcher(); - - void add(Base &); - void remove(Base &); - - /** Checks for and dispatches events. If there are no events available, - blocks until there are. */ - 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: - void object_events_changed(PollEvent, Base *); - void object_deleted(Base *); - void dispatch(); -}; - -} // namespace IO -} // namespace Msp - -#endif