6 #include <msp/core/mspcore_api.h>
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 MSPCORE_API Poller: private NonCopyable
47 std::vector<PolledObject> objects;
48 Private *priv = nullptr;
49 bool events_changed = false;
50 bool objs_changed = false;
51 std::vector<PolledObject> poll_result;
57 void set_object(EventObject &, PollEvent);
59 unsigned poll(const Time::TimeDelta &);
62 unsigned do_poll(int);
63 void platform_poll(int);
65 const std::vector<PolledObject> &get_result() const { return poll_result; }
68 MSPCORE_API PollEvent poll(EventObject &, PollEvent);
69 MSPCORE_API PollEvent poll(EventObject &, PollEvent, const Time::TimeDelta &);