]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/poll.cpp
Add missing includes for Windows platform
[libs/core.git] / source / io / poll.cpp
index 4ca2f3d9767ea3315d172ba25dd51831afb7f660..683eabe17a287c67f3ccab63925daf1770274c4c 100644 (file)
@@ -1,4 +1,4 @@
-#include <stdexcept>
+#include <msp/core/except.h>
 #include <msp/core/algorithm.h>
 #include "eventobject.h"
 #include "poll.h"
@@ -10,9 +10,7 @@ namespace Msp {
 namespace IO {
 
 Poller::Poller():
-       priv(new Private),
-       events_changed(false),
-       objs_changed(false)
+       priv(new Private)
 { }
 
 Poller::~Poller()
@@ -46,7 +44,7 @@ void Poller::set_object(EventObject &obj, PollEvent ev)
 
 #ifdef _WIN32
        if(objects.size()>=MAXIMUM_WAIT_OBJECTS)
-               throw logic_error("Maximum number of wait objects reached");
+               throw invalid_state("too many objects");
 #endif
 
        objects.push_back(PolledObject(&obj, ev));
@@ -93,7 +91,7 @@ PollEvent poll(EventObject &obj, PollEvent pe)
 PollEvent poll(EventObject &obj, PollEvent pe, const Time::TimeDelta &timeout)
 {
        if(timeout<Time::zero)
-               throw invalid_argument("poll");
+               throw invalid_argument("IO::poll");
 
        return platform_poll(obj, pe, static_cast<int>(timeout/Time::msec));
 }