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
46 std::vector<PolledObject> objects;
47 Private *priv = nullptr;
48 bool events_changed = false;
49 bool objs_changed = false;
50 std::vector<PolledObject> poll_result;
56 void set_object(EventObject &, PollEvent);
58 unsigned poll(const Time::TimeDelta &);
61 unsigned do_poll(int);
62 void platform_poll(int);
64 const std::vector<PolledObject> &get_result() const { return poll_result; }
67 PollEvent poll(EventObject &, PollEvent);
68 PollEvent poll(EventObject &, PollEvent, const Time::TimeDelta &);