Add basic deleter support to wxSharedPtr<T>.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74773 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -28,6 +28,22 @@ public:
|
||||
*/
|
||||
wxEXPLICIT wxSharedPtr(T* ptr = NULL);
|
||||
|
||||
/**
|
||||
Constructor.
|
||||
|
||||
Creates shared pointer from the raw pointer @a ptr and deleter @a d
|
||||
and takes ownership of it.
|
||||
|
||||
@param ptr The raw pointer.
|
||||
@param d Deleter - a functor that is called instead of delete to
|
||||
free the @a ptr raw pointer when its reference count drops to
|
||||
zero.
|
||||
|
||||
@since 3.0
|
||||
*/
|
||||
template<typename Deleter>
|
||||
wxEXPLICIT wxSharedPtr(T* ptr, Deleter d);
|
||||
|
||||
/**
|
||||
Copy constructor.
|
||||
*/
|
||||
@@ -88,6 +104,21 @@ public:
|
||||
*/
|
||||
void reset(T* ptr = NULL);
|
||||
|
||||
/**
|
||||
Reset pointer to @a ptr.
|
||||
|
||||
If the reference count of the previously owned pointer was 1 it will be deleted.
|
||||
|
||||
@param ptr The new raw pointer.
|
||||
@param d Deleter - a functor that is called instead of delete to
|
||||
free the @a ptr raw pointer when its reference count drops to
|
||||
zero.
|
||||
|
||||
@since 3.0
|
||||
*/
|
||||
template<typename Deleter>
|
||||
void reset(T* ptr, Deleter d);
|
||||
|
||||
/**
|
||||
Returns @true if this is the only pointer pointing to its object.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user