X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f090e4ef6753479f3c3d2ea3ec1f692241540d65..044388d13fb138fb202f1dd9afab511efd68ad5f:/interface/wx/sharedptr.h diff --git a/interface/wx/sharedptr.h b/interface/wx/sharedptr.h index 92e94a8759..8b7087baed 100644 --- a/interface/wx/sharedptr.h +++ b/interface/wx/sharedptr.h @@ -2,7 +2,6 @@ // Name: sharedptr.h // Purpose: interface of wxSharedPtr // Author: wxWidgets team -// RCS-ID: $Id$ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -29,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 + wxEXPLICIT wxSharedPtr(T* ptr, Deleter d); + /** Copy constructor. */ @@ -89,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 + void reset(T* ptr, Deleter d); + /** Returns @true if this is the only pointer pointing to its object. */