X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fio%2Fpoll.cpp;h=7aa41e1c330c9ac41ae5ebdf9fa96eb3678a274c;hb=HEAD;hp=4ca2f3d9767ea3315d172ba25dd51831afb7f660;hpb=f24e7b96e76b63c9b9b8a6bce4c7a9db64276ea8;p=libs%2Fcore.git diff --git a/source/io/poll.cpp b/source/io/poll.cpp index 4ca2f3d..7aa41e1 100644 --- a/source/io/poll.cpp +++ b/source/io/poll.cpp @@ -1,4 +1,4 @@ -#include +#include #include #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,10 +44,10 @@ 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)); + objects.push_back({ &obj, ev }); objs_changed = true; } @@ -93,7 +91,7 @@ PollEvent poll(EventObject &obj, PollEvent pe) PollEvent poll(EventObject &obj, PollEvent pe, const Time::TimeDelta &timeout) { if(timeout(timeout/Time::msec)); }