new class: WaitHandleList helper for waiting on multiple events using the Win32 api.

This commit is contained in:
Eelke Klein 2017-01-06 07:22:35 +01:00
parent f396965797
commit 2d420c0525
2 changed files with 57 additions and 0 deletions

26
waithandlelist.h Normal file
View file

@ -0,0 +1,26 @@
#ifndef WAITHANDLELIST_H
#define WAITHANDLELIST_H
#include <windows.h>
#include <vector>
class Win32Event;
using WaitResultValue = DWORD;
class WaitHandleList {
public:
WaitHandleList();
~WaitHandleList();
WaitResultValue add(HANDLE h);
WaitResultValue add(Win32Event &e);
DWORD count() const;
void clear();
operator const HANDLE*() const;
private:
std::vector<HANDLE> m_waitHandles;
};
#endif // WAITHANDLELIST_H