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 Slot(EventObject *o, PollEvent e): object(o), events(e) { }
46 typedef std::vector<Slot> SlotList DEPRECATED;
50 std::vector<Slot> objects;
54 std::vector<Slot> poll_result;
60 void set_object(EventObject &, PollEvent);
62 int poll(const Time::TimeDelta &);
66 void platform_poll(int);
68 const std::vector<Slot> &get_result() const { return poll_result; }
71 PollEvent poll(EventObject &, PollEvent);
72 PollEvent poll(EventObject &, PollEvent, const Time::TimeDelta &);