X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Feventdispatcher.h;h=7e89d4739e845f0e0c180845ffedb43184eefd9f;hb=b97d4e9f86e90254ab9edef7ee62a910f6333c78;hp=8142b080e2bec9140ddccc1be51ba5f70222fc7c;hpb=8b29f7bad5fac36817424fedd2b6206df9d545c5;p=libs%2Fcore.git diff --git a/source/eventdispatcher.h b/source/eventdispatcher.h index 8142b08..7e89d47 100644 --- a/source/eventdispatcher.h +++ b/source/eventdispatcher.h @@ -1,9 +1,3 @@ -/* $Id$ - -This file is part of libmspio -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ #ifndef EVENTDISPATCHER_H_ #define EVENTDISPATCHER_H_ @@ -20,22 +14,6 @@ on some of them. */ class EventDispatcher: public sigc::trackable { -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: struct Slot { @@ -45,11 +23,27 @@ private: 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();