]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/poll.h
Make sure all classes have sensible copy semantics
[libs/core.git] / source / io / poll.h
index 78e6088f8bfe0f5289864550136cedab5154df84..b65166d24bffb7cf8d7aea7e30f09f525c7b84d2 100644 (file)
@@ -4,6 +4,7 @@
 #include <list>
 #include <map>
 #include <vector>
+#include <msp/core/noncopyable.h>
 #include <msp/time/timedelta.h>
 
 namespace Msp {
@@ -17,7 +18,8 @@ enum PollEvent
        P_INPUT = 1,
        P_PRIO = 2,
        P_OUTPUT = 4,
-       P_ERROR = 8
+       P_ERROR = 8,
+       P_HANGUP = 16
 };
 
 inline PollEvent operator|(PollEvent e, PollEvent f)
@@ -30,7 +32,7 @@ inline PollEvent operator~(PollEvent e)
 { return PollEvent(~static_cast<int>(e)); }
 
 
-class Poller
+class Poller: private NonCopyable
 {
 public:
        struct Slot
@@ -54,6 +56,7 @@ private:
 
 public:
        Poller();
+       ~Poller();
 
        void set_object(EventObject &, PollEvent);
        int poll();
@@ -61,6 +64,7 @@ public:
 private:
        void rebuild_array();
        int do_poll(int);
+       void platform_poll(int);
 public:
        const SlotList &get_result() const { return poll_result; }
 };