|
Sunshine master
Self-hosted game stream host for Moonlight.
|
Unique pointer wrapper with customizable pointer and deleter types. More...
#include <src/utility.h>
Public Types | |
| using | const_pointer = element_type const * |
| Const pointer type exposed by the unique pointer wrapper. | |
| using | deleter_type = D |
| Callable type used to release the managed pointer. | |
| using | element_type = T |
| Object type managed by the unique pointer wrapper. | |
| using | pointer = element_type * |
| Pointer type stored by the unique pointer wrapper. | |
Public Member Functions | |
| pointer | get () |
| Return the currently wrapped value or handle. | |
| const_pointer | get () const |
| Return the currently wrapped value or handle. | |
| deleter_type & | get_deleter () |
| Return the deleter used when resetting the wrapped pointer. | |
| const deleter_type & | get_deleter () const |
| Return the deleter used when resetting the wrapped pointer. | |
| operator bool () const | |
| Check whether the wrapper currently owns a non-null pointer. | |
| pointer * | operator& () |
| Expose the stored pointer address for C APIs that write handles. | |
| pointer * | operator& () const |
| Expose the stored pointer address for C APIs that write handles. | |
| std::add_lvalue_reference_t< element_type > | operator* () |
| Dereference the managed pointer. | |
| std::add_lvalue_reference_t< element_type const > | operator* () const |
| Dereference the managed pointer. | |
| pointer | operator-> () |
| Access members of the managed pointer. | |
| const_pointer | operator-> () const |
| Access members of the managed pointer. | |
| uniq_ptr & | operator= (const uniq_ptr &other) noexcept=delete |
| template<class V > | |
| uniq_ptr & | operator= (std::unique_ptr< V, deleter_type > &&uniq) noexcept |
| Assign state from another instance while preserving ownership semantics. | |
| template<class V > | |
| uniq_ptr & | operator= (uniq_ptr< V, deleter_type > &&other) noexcept |
| Assign state from another instance while preserving ownership semantics. | |
| pointer | release () |
| Release the COM or platform reference owned by the pointer. | |
| void | reset (pointer p=pointer()) |
| Reset the object to its initial empty state. | |
| uniq_ptr (const uniq_ptr &other) noexcept=delete | |
| constexpr | uniq_ptr (std::nullptr_t) noexcept |
| Construct a unique ownership wrapper. | |
| template<class V > | |
| uniq_ptr (std::unique_ptr< V, deleter_type > &&uniq) noexcept | |
| Construct a unique ownership wrapper. | |
| template<class V > | |
| uniq_ptr (uniq_ptr< V, deleter_type > &&other) noexcept | |
| Construct a unique ownership wrapper. | |
| template<class V > | |
| uniq_ptr (V *p) noexcept | |
| Construct a unique ownership wrapper. | |
Protected Attributes | |
| deleter_type | _deleter |
Callable used to release _p. | |
| pointer | _p |
| Pointer currently owned by the wrapper. | |
Unique pointer wrapper with customizable pointer and deleter types.
|
inlinenoexcept |
Construct a unique ownership wrapper.
| p | Pointer passed to the deleter or conversion helper. |
|
inlinenoexcept |
Construct a unique ownership wrapper.
| uniq | Unique pointer whose owned value is transferred. |
|
inlinenoexcept |
Construct a unique ownership wrapper.
| other | Source object whose state is copied or moved into this object. |
|
inline |
Return the currently wrapped value or handle.
|
inline |
Return the currently wrapped value or handle.
|
inline |
Return the deleter used when resetting the wrapped pointer.
|
inline |
Return the deleter used when resetting the wrapped pointer.
|
inline |
Expose the stored pointer address for C APIs that write handles.
|
inline |
Expose the stored pointer address for C APIs that write handles.
|
inline |
Dereference the managed pointer.
|
inline |
Dereference the managed pointer.
|
inline |
Access members of the managed pointer.
|
inline |
Access members of the managed pointer.
|
inlinenoexcept |
Assign state from another instance while preserving ownership semantics.
| uniq | Unique pointer whose owned value is transferred. |
|
inlinenoexcept |
Assign state from another instance while preserving ownership semantics.
| other | Source object whose state is copied or moved into this object. |
|
inline |
Release the COM or platform reference owned by the pointer.
|
inline |
Reset the object to its initial empty state.
| p | Pointer passed to the deleter or conversion helper. |