25 #ifndef INCLUDED_SignalEvent_h_GUID_DD338B8E_2CC9_43B8_0699_13169941BD2E
26 #define INCLUDED_SignalEvent_h_GUID_DD338B8E_2CC9_43B8_0699_13169941BD2E
37 #define WIN32_LEAN_AND_MEAN
49 : h_(CreateEvent(nullptr, manual, false, nullptr)) {
51 throw std::runtime_error(
"Could not create Windows event handle!");
58 void set() { SetEvent(h_); }
61 void clear() { ResetEvent(h_); }
64 bool wait() {
return WAIT_OBJECT_0 == WaitForSingleObject(h_, INFINITE); }
69 bool wait(DWORD milliseconds) {
70 return WAIT_OBJECT_0 == WaitForSingleObject(h_, milliseconds);
79 #endif // INCLUDED_SignalEvent_h_GUID_DD338B8E_2CC9_43B8_0699_13169941BD2E
~SignalEvent()
Destructor.
bool wait(DWORD milliseconds)
void set()
Set or signal the event.
SignalEvent(bool manual=false)
Constructor.
void clear()
Un-signal the event (not usually necessary for auto=reset events)