A Windows service handle that closes itself on destruct.
More...
#include <xentara/utils/windows/service/ServiceHandle.hpp>
|
| using | NativeType = SC_HANDLE |
| | A native Windows service handle.
|
| |
|
| constexpr | ServiceHandle () noexcept=default |
| | Default constructor.
|
| |
| constexpr | ServiceHandle (SC_HANDLE nativeHandle) noexcept |
| | Conversion from a native handle.
|
| |
| constexpr | ServiceHandle (ServiceHandle &&other) noexcept |
| | Move constructor.
|
| |
| | ~ServiceHandle () |
| | Destructor. Silently closes the handle.
|
| |
| auto | operator= (ServiceHandle &&rhs) noexcept -> ServiceHandle & |
| | Move assignment operator.
|
| |
| | operator SC_HANDLE () const |
| | Conversion to a native Windows service handle.
|
| |
| constexpr | operator bool () const noexcept |
| | Checks whether the object contains a handle.
|
| |
| auto | operator= (SC_HANDLE nativeHandle) noexcept -> ServiceHandle & |
| | Assignment from a native handle.
|
| |
| constexpr auto | release () noexcept -> SC_HANDLE |
| | Removes the handle and passes ownership to the caller.
|
| |
| auto | close () noexcept -> bool |
| | Closes the handle, if any.
|
| |
| auto | setter () noexcept -> Setter |
| | Gets a setter for use as an output parameter for C functions.
|
| |
A Windows service handle that closes itself on destruct.
◆ NativeType
A native Windows service handle.
◆ ServiceHandle() [1/3]
| constexpr xentara::utils::windows::service::ServiceHandle::ServiceHandle |
( |
| ) |
|
|
constexprdefaultnoexcept |
Default constructor.
Creates an empty object that does not contain a handle.
◆ ServiceHandle() [2/3]
| constexpr xentara::utils::windows::service::ServiceHandle::ServiceHandle |
( |
SC_HANDLE |
nativeHandle | ) |
|
|
constexprnoexcept |
Conversion from a native handle.
◆ ServiceHandle() [3/3]
| constexpr xentara::utils::windows::service::ServiceHandle::ServiceHandle |
( |
ServiceHandle && |
other | ) |
|
|
constexprnoexcept |
◆ ~ServiceHandle()
| xentara::utils::windows::service::ServiceHandle::~ServiceHandle |
( |
| ) |
|
Destructor. Silently closes the handle.
◆ close()
| auto xentara::utils::windows::service::ServiceHandle::close |
( |
| ) |
-> bool |
|
noexcept |
Closes the handle, if any.
◆ operator bool()
| constexpr xentara::utils::windows::service::ServiceHandle::operator bool |
( |
| ) |
const |
|
explicitconstexprnoexcept |
Checks whether the object contains a handle.
◆ operator SC_HANDLE()
| xentara::utils::windows::service::ServiceHandle::operator SC_HANDLE |
( |
| ) |
const |
Conversion to a native Windows service handle.
◆ operator=() [1/2]
| auto xentara::utils::windows::service::ServiceHandle::operator= |
( |
SC_HANDLE |
nativeHandle | ) |
-> ServiceHandle &
|
|
noexcept |
Assignment from a native handle.
◆ operator=() [2/2]
Move assignment operator.
◆ release()
| constexpr auto xentara::utils::windows::service::ServiceHandle::release |
( |
| ) |
-> SC_HANDLE
|
|
constexprnoexcept |
Removes the handle and passes ownership to the caller.
◆ setter()
| auto xentara::utils::windows::service::ServiceHandle::setter |
( |
| ) |
-> Setter |
|
noexcept |
Gets a setter for use as an output parameter for C functions.