Use vectors for storage in Poller
[libs/core.git] / source / io / poll.h
index b65166d24bffb7cf8d7aea7e30f09f525c7b84d2..fdb68c515bbe35e0e05cafdde93e59c625a7bced 100644 (file)
@@ -1,9 +1,9 @@
 #ifndef MSP_IO_POLL_H_
 #define MSP_IO_POLL_H_
 
-#include <list>
 #include <map>
 #include <vector>
+#include <msp/core/attributes.h>
 #include <msp/core/noncopyable.h>
 #include <msp/time/timedelta.h>
 
@@ -43,16 +43,15 @@ public:
                Slot(EventObject *o, PollEvent e): object(o), events(e) { }
        };
 
-       typedef std::list<Slot> SlotList;
+       typedef std::vector<Slot> SlotList DEPRECATED;
 private:
-       typedef std::map<EventObject *, PollEvent> EventMap;
-
        struct Private;
 
-       EventMap objects;
+       std::vector<Slot> objects;
        Private *priv;
+       bool events_changed;
        bool objs_changed;
-       SlotList poll_result;
+       std::vector<Slot> poll_result;
 
 public:
        Poller();
@@ -66,7 +65,7 @@ private:
        int do_poll(int);
        void platform_poll(int);
 public:
-       const SlotList &get_result() const { return poll_result; }
+       const std::vector<Slot> &get_result() const { return poll_result; }
 };
 
 PollEvent poll(EventObject &, PollEvent);