7 #include <msp/core/noncopyable.h>
8 #include <msp/time/timedelta.h>
25 inline PollEvent operator|(PollEvent e, PollEvent f)
26 { return PollEvent(static_cast<int>(e)|static_cast<int>(f)); }
28 inline PollEvent operator&(PollEvent e, PollEvent f)
29 { return PollEvent(static_cast<int>(e)&static_cast<int>(f)); }
31 inline PollEvent operator~(PollEvent e)
32 { return PollEvent(~static_cast<int>(e)); }
35 class Poller: private NonCopyable
43 Slot(EventObject *o, PollEvent e): object(o), events(e) { }
46 typedef std::list<Slot> SlotList;
48 typedef std::map<EventObject *, PollEvent> EventMap;
61 void set_object(EventObject &, PollEvent);
63 int poll(const Time::TimeDelta &);
67 void platform_poll(int);
69 const SlotList &get_result() const { return poll_result; }
72 PollEvent poll(EventObject &, PollEvent);
73 PollEvent poll(EventObject &, PollEvent, const Time::TimeDelta &);