17 #ifndef LIB_WINSS_HANDLE_WRAPPER_HPP_ 18 #define LIB_WINSS_HANDLE_WRAPPER_HPP_ 22 #include "easylogging/easylogging++.hpp" 52 static WaitResult Wait(DWORD timeout,
const std::vector<HANDLE>& handles);
73 DWORD dup_rights = 0);
132 template<
typename Iterator>
134 std::vector<HANDLE> handles;
136 for (
auto it = begin; it != end; ++it) {
137 handles.push_back(it->handle);
141 VLOG(7) <<
"Wait status: " << result.
state;
365 HANDLE GetHandle()
const;
403 #endif // LIB_WINSS_HANDLE_WRAPPER_HPP_ The wait result for when waiting on handles.
Definition: handle_wrapper.hpp:397
A wrapper for a Windows HANDLE.
Definition: handle_wrapper.hpp:39
bool operator<(const HandleWrapper &rhs) const
Checks this handle is less than the rhs.
Definition: handle_wrapper.cpp:103
HANDLE handle
The wrapped handle.
Definition: handle_wrapper.hpp:42
HandleWrapper & operator=(const HandleWrapper &h)
Copies the handle wrapper.
Definition: handle_wrapper.cpp:125
DWORD dup_rights
The duplicate rights.
Definition: handle_wrapper.hpp:43
bool IsOwner() const
Gets if this instance owns the handle.
Definition: handle_wrapper.cpp:41
bool owned
If this instance owns the handle.
Definition: handle_wrapper.hpp:41
bool operator!=(const HandleWrapper &rhs) const
Checks the handles are not equal.
Definition: handle_wrapper.cpp:99
virtual ~HandleWrapper()
Cleans up the handle.
Definition: handle_wrapper.cpp:148
bool operator>=(const HandleWrapper &rhs) const
Checks this handle is greater than or equal to the rhs.
Definition: handle_wrapper.cpp:115
Definition: case_ignore.hpp:23
HANDLE Duplicate(bool inherit) const
Duplicates the handle.
Definition: handle_wrapper.cpp:79
bool operator<=(const HandleWrapper &rhs) const
Checks this handle is less than or equal to the rhs.
Definition: handle_wrapper.cpp:107
bool HasHandle() const
Gets if the wrapper contains a handle.
Definition: handle_wrapper.cpp:37
bool operator==(const HandleWrapper &rhs) const
Checks the handles are equal.
Definition: handle_wrapper.cpp:95
static WaitResult Wait(DWORD timeout, Iterator begin, Iterator end)
Waits for an event on a sequence of handles.
Definition: handle_wrapper.hpp:133
static WaitResult Wait(DWORD timeout, const std::vector< HANDLE > &handles)
Waits for an event to happen on the given list of handles.
Definition: handle_wrapper.cpp:49
The wait timed out.
Definition: handle_wrapper.hpp:30
bool operator>(const HandleWrapper &rhs) const
Checks this handle is greater than the rhs.
Definition: handle_wrapper.cpp:111
DWORD GetDuplicateRights() const
Gets the duplicate rights of the handle.
Definition: handle_wrapper.cpp:45
WaitResultState state
Definition: handle_wrapper.hpp:398
HandleWrapper()
Create an empty handle wrapper.
Definition: handle_wrapper.cpp:23
The wait was a success.
Definition: handle_wrapper.hpp:29
Definition: handle_wrapper.hpp:327
HandleWrapper handle
Definition: handle_wrapper.hpp:399
void CloseHandle()
Close the handle if the instance owns it.
Definition: handle_wrapper.cpp:119
WaitResultState
The wait result state for when waiting on handles.
Definition: handle_wrapper.hpp:28
The wait failed.
Definition: handle_wrapper.hpp:31