A RAII wrapper around Microsoft Windows HANDLE.
More...
#include <win_handle.hpp>
|
| static bool | is_valid (const HANDLE &handle) |
| | Checks whether handle is valid. More...
|
| |
A RAII wrapper around Microsoft Windows HANDLE.
This class is a movable, non-copyable RAII wrapper on HANDLE.
◆ ~win_handle()
| virtual fsw::win_handle::~win_handle |
( |
| ) |
|
|
virtual |
◆ win_handle()
| fsw::win_handle::win_handle |
( |
win_handle && |
other | ) |
|
|
noexcept |
Move constructor.
The move constructors moves the handle value wrapped by other to the target instance. The handle value in other is set to INVALID_HANDLE_VALUE. The previously wrapped instance is closed invoking CloseHandle if it is valid.
- Parameters
-
◆ is_valid() [1/2]
| bool fsw::win_handle::is_valid |
( |
| ) |
const |
Checks whether the handle is valid.
- Returns
- Returns
true if the handle is valid, false otherwise.
- See also
- is_valid()
◆ is_valid() [2/2]
| static bool fsw::win_handle::is_valid |
( |
const HANDLE & |
handle | ) |
|
|
static |
Checks whether handle is valid.
A handle is valid is if its value is not null and if is not INVALID_HANDLE_VALUE.
- Parameters
-
| handle | The handle to check. |
- Returns
- Returns
true if handle is valid, false otherwise.
◆ operator=() [1/2]
| win_handle & fsw::win_handle::operator= |
( |
const HANDLE & |
handle | ) |
|
Assigns a handle to the current instance.
The previously wrapped instance is closed invoking CloseHandle if it is valid.
- Parameters
-
| handle | The handle value to assign to the current instance. |
◆ operator=() [2/2]
Move assignment operator.
The move assignment operator moves the handle value wrapped by other to the target instance. The handle value in other is set to INVALID_HANDLE_VALUE. The previously wrapped instance is closed invoking CloseHandle if it is valid.
- Parameters
-
The documentation for this class was generated from the following file: