6 #include <msp/core/attributes.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 Poller: private NonCopyable
43 PolledObject(EventObject *o, PollEvent e): object(o), events(e) { }
46 typedef PolledObject Slot DEPRECATED;
48 typedef std::vector<PolledObject> SlotList DEPRECATED;
52 std::vector<PolledObject> objects;
56 std::vector<PolledObject> poll_result;
62 void set_object(EventObject &, PollEvent);
64 unsigned poll(const Time::TimeDelta &);
67 unsigned do_poll(int);
68 void platform_poll(int);
70 const std::vector<PolledObject> &get_result() const { return poll_result; }
73 PollEvent poll(EventObject &, PollEvent);
74 PollEvent poll(EventObject &, PollEvent, const Time::TimeDelta &);