Sunshine master
Self-hosted game stream host for Moonlight.
nvprefs::safe_handle Struct Reference

Owning Windows HANDLE wrapper that closes handles automatically. More...

#include <src/platform/windows/nvprefs/nvprefs_common.h>

Inheritance diagram for nvprefs::safe_handle:
[legend]
Collaboration diagram for nvprefs::safe_handle:
[legend]

Public Member Functions

 operator bool () const
 Check whether the wrapped Windows handle is valid.
 
- Public Member Functions inherited from util::uniq_ptr< T, D >
pointer get ()
 Return the currently wrapped value or handle.
 
const_pointer get () const
 Return the currently wrapped value or handle.
 
deleter_typeget_deleter ()
 Return the deleter used when resetting the wrapped pointer.
 
const deleter_typeget_deleter () const
 Return the deleter used when resetting the wrapped pointer.
 
 operator bool () const
 Check whether the wrapper currently owns a non-null pointer.
 
pointeroperator& ()
 Expose the stored pointer address for C APIs that write handles.
 
pointeroperator& () const
 Expose the stored pointer address for C APIs that write handles.
 
std::add_lvalue_reference_t< element_typeoperator* ()
 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_ptroperator= (const uniq_ptr &other) noexcept=delete
 
template<class V >
uniq_ptroperator= (std::unique_ptr< V, deleter_type > &&uniq) noexcept
 Assign state from another instance while preserving ownership semantics.
 
template<class V >
uniq_ptroperator= (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.
 

Additional Inherited Members

- Public Types inherited from util::uniq_ptr< T, D >
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.
 
- Protected Attributes inherited from util::uniq_ptr< T, D >
deleter_type _deleter
 Callable used to release _p.
 
pointer _p
 Pointer currently owned by the wrapper.
 

Detailed Description

Owning Windows HANDLE wrapper that closes handles automatically.


The documentation for this struct was generated from the following file: