-#include <stdexcept>
+#include <msp/core/except.h>
#include <msp/core/algorithm.h>
#include "eventobject.h"
#include "poll.h"
#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;
}
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));
}