PStack  2.0
Stack trace printer for MSVC and GCC binaries
psystem::shared_handle< T, kInvalidHandle >::shared_handle_data_with_delete< D > Struct Template Reference

A control block for a shared_handle with a user-specified deleter. More...

Inheritance diagram for psystem::shared_handle< T, kInvalidHandle >::shared_handle_data_with_delete< D >:
Collaboration diagram for psystem::shared_handle< T, kInvalidHandle >::shared_handle_data_with_delete< D >:

Public Types

using deleter_type = D
 The facility used to clean handle resources.
 

Public Member Functions

 shared_handle_data_with_delete (deleter_type const &deleter) noexcept
 Construct this instance with a custom deleter. More...
 
 shared_handle_data_with_delete (deleter_type &&deleter) noexcept
 Construct this instance by taking ownership of a deleter. More...
 
virtual void delete_handle (T hndl) noexcept override
 Invoke the provided deleter to clean up handle resources. More...
 
- Public Member Functions inherited from psystem::shared_handle< T, kInvalidHandle >::shared_handle_data
 shared_handle_data () noexcept
 Initialize a usage count of 1 and a weak-usage count of 1.
 
virtual ~shared_handle_data () noexcept
 Provide a virtual destructor for polymorphic deletion.
 

Public Attributes

deleter_type m_deleter
 A user-provided handle deletion utility.
 
- Public Attributes inherited from psystem::shared_handle< T, kInvalidHandle >::shared_handle_data
std::atomic< size_t > m_usage_count
 The count of shared_handle instances that are managing this handle.
 
std::atomic< size_t > m_weak_count
 The "weak" reference count (manages the control block). More...
 

Detailed Description

template<typename T = HANDLE, T kInvalidHandle = INVALID_HANDLE_VALUE>
template<typename D>
struct psystem::shared_handle< T, kInvalidHandle >::shared_handle_data_with_delete< D >

A control block for a shared_handle with a user-specified deleter.

Template Parameters
DThe deleter type. It should be callable with the function signature, "void(T handle)".

Constructor & Destructor Documentation

template<typename T = HANDLE, T kInvalidHandle = INVALID_HANDLE_VALUE>
template<typename D >
psystem::shared_handle< T, kInvalidHandle >::shared_handle_data_with_delete< D >::shared_handle_data_with_delete ( deleter_type const &  deleter)
inlineexplicitnoexcept

Construct this instance with a custom deleter.

Parameters
[in]deleterThe deleter to copy into this instance.
Warning
The deleter must be copy-constructable and must not throw.
template<typename T = HANDLE, T kInvalidHandle = INVALID_HANDLE_VALUE>
template<typename D >
psystem::shared_handle< T, kInvalidHandle >::shared_handle_data_with_delete< D >::shared_handle_data_with_delete ( deleter_type &&  deleter)
inlineexplicitnoexcept

Construct this instance by taking ownership of a deleter.

Parameters
[in]deleterThe deleter to own.
Warning
The deleter must be move-constructable and must not throw.

Member Function Documentation

template<typename T = HANDLE, T kInvalidHandle = INVALID_HANDLE_VALUE>
template<typename D >
virtual void psystem::shared_handle< T, kInvalidHandle >::shared_handle_data_with_delete< D >::delete_handle ( hndl)
inlineoverridevirtualnoexcept

Invoke the provided deleter to clean up handle resources.

Parameters
[in]hndlThe handle to close.

Reimplemented from psystem::shared_handle< T, kInvalidHandle >::shared_handle_data.


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