|
C++ Essence Library 0.1.0
A Utility Library for Modern C++ Programming
|
Manages a platform-dependent handle. More...
#include <managed_handle.hpp>
Public Types | |
| using | native_type = basic_native_handle<T, Mapped, Validator> |
| using | value_type = std::conditional_t<Shared, std::shared_ptr<void>, std::unique_ptr<void, void (*)(void*)>> |
Public Member Functions | |
| basic_managed_handle (std::nullptr_t=nullptr) noexcept | |
| template<typename U > requires std::is_pointer_v<U> | |
| basic_managed_handle (U value) | |
| Constructs the object from a pointer. | |
| basic_managed_handle (Mapped value) | |
| Constructs the object from a mapped number. | |
| basic_managed_handle (const basic_managed_handle &)=default | |
| basic_managed_handle (basic_managed_handle &&) noexcept=default | |
| basic_managed_handle & | operator= (const basic_managed_handle &)=default |
| basic_managed_handle & | operator= (basic_managed_handle &&) noexcept=default |
| operator bool () const noexcept | |
| Checks whether the stored value is a valid handle. | |
| native_type | get () const noexcept |
| Gets the stored handle. | |
| void | reset () noexcept |
| Deletes the handle and resets the value. | |
| template<typename U > requires std::is_pointer_v<U> | |
| void | reset (U value) noexcept |
| Resets the object with a pointer. | |
| void | reset (Mapped value) noexcept |
| Resets the object with a mapped number. | |
| void | swap (basic_managed_handle &other) noexcept |
| Swaps the handle value with another one. | |
Manages a platform-dependent handle.
| Mapped | The integral type to map the T value to (default T). |
| Shared | true to use std::shared_ptr; otherwise std::unique_ptr. |
| T | The underlying storage type. |
| Deleter | A callable object to delete the handle. |
| Validator | A callable object to validate the handle. |
|
inlineexplicit |
Constructs the object from a pointer.
| U | The pointer type. |
| value | The pointer value. |
|
inlineexplicit |
Constructs the object from a mapped number.
| value | The mapped number. |
|
inlinenoexcept |
Gets the stored handle.
|
inlineexplicitnoexcept |
Checks whether the stored value is a valid handle.
|
inlinenoexcept |
Resets the object with a mapped number.
| value | The mapped number. |
|
inlinenoexcept |
Resets the object with a pointer.
| U | The pointer type. |
| value | The pointer value. |
|
inlinenoexcept |
Swaps the handle value with another one.
| other | The other object. |