6 #include <msp/core/noncopyable.h>
7 #include <msp/time/timedelta.h>
24 inline PollEvent operator|(PollEvent e, PollEvent f)
25 { return PollEvent(static_cast<int>(e)|static_cast<int>(f)); }
27 inline PollEvent operator&(PollEvent e, PollEvent f)
28 { return PollEvent(static_cast<int>(e)&static_cast<int>(f)); }
30 inline PollEvent operator~(PollEvent e)
31 { return PollEvent(~static_cast<int>(e)); }
34 class Poller: private NonCopyable
42 PolledObject(EventObject *o, PollEvent e): object(o), events(e) { }
48 std::vector<PolledObject> objects;
52 std::vector<PolledObject> poll_result;
58 void set_object(EventObject &, PollEvent);
60 unsigned poll(const Time::TimeDelta &);
63 unsigned do_poll(int);
64 void platform_poll(int);
66 const std::vector<PolledObject> &get_result() const { return poll_result; }
69 PollEvent poll(EventObject &, PollEvent);
70 PollEvent poll(EventObject &, PollEvent, const Time::TimeDelta &);