#define EVENTDISPATCHER_H_
#include <sigc++/connection.h>
+#include <sigc++/trackable.h>
#include "poll.h"
namespace Msp {
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();
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
{
void object_events_changed(PollEvent, Base *);
void object_deleted(Base *);
+ void dispatch();
};
} // namespace IO