X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3f66f6a5b3583b02c34854556eb83e3a808524ce..92c0fc34c104c8d7c12d6a3b78ea232690fc23f4:/interface/wx/sharedptr.h?ds=inline diff --git a/interface/wx/sharedptr.h b/interface/wx/sharedptr.h index f3c2131c35..8b7087baed 100644 --- a/interface/wx/sharedptr.h +++ b/interface/wx/sharedptr.h @@ -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 + 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 + void reset(T* ptr, Deleter d); + /** Returns @true if this is the only pointer pointing to its object. */