X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e25cd7750c571191ce69438de5f7c0293d1b5270..36a0190ebd5bd9a7302f60f6dcd608b80574e21c:/interface/wx/weakref.h?ds=inline diff --git a/interface/wx/weakref.h b/interface/wx/weakref.h index c06a27e111..e954c26a3a 100644 --- a/interface/wx/weakref.h +++ b/interface/wx/weakref.h @@ -2,14 +2,11 @@ // Name: weakref.h // Purpose: interface of wxWeakRefDynamic, wxWeakRef // Author: wxWidgets team -// RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** - @class wxWeakRefDynamic - wxWeakRefDynamic is a template class for weak references that is used in the same way as wxWeakRef. The only difference is that wxWeakRefDynamic defaults to using @c dynamic_cast for establishing the object reference @@ -20,7 +17,7 @@ is to handle objects which derived type one does not know. @note wxWeakRef selects an implementation based on the static type of T. - If T does not have wxTrackable statically, it defaults to to a mixed- + If T does not have wxTrackable statically, it defaults to a mixed- mode operation, where it uses @c dynamic_cast as the last measure (if available from the compiler and enabled when building wxWidgets). @@ -28,8 +25,11 @@ For API documentation, see: wxWeakRef. + @tparam T + The type to which the smart pointer points to. + @nolibrary - @category{misc} + @category{smartpointers} */ template class wxWeakRefDynamic @@ -41,8 +41,6 @@ public: /** - @class wxWeakRef - wxWeakRef is a template class for weak references to wxWidgets objects, such as wxEvtHandler, wxWindow and wxObject. A weak reference behaves much like an ordinary pointer, but when the object @@ -91,8 +89,11 @@ public: typedef wxWeakRef wxWindowRef; @endcode + @tparam T + The type to which the smart pointer points to. + @nolibrary - @category{misc} + @category{smartpointers} @see wxSharedPtr, wxScopedPtr */ @@ -100,6 +101,9 @@ template class wxWeakRef : public wxTrackerNode { public: + /// Type of the element stored by this reference. + typedef T element_type; + /** Constructor. The weak reference is initialized to @e pobj. */ @@ -113,7 +117,7 @@ public: /** Destructor. */ - ~wxWeakRef(); + virtual ~wxWeakRef(); /** Called when the tracked object is destroyed. Be default sets @@ -151,11 +155,10 @@ public: T& operator*() const; /** - Smart pointer member access. - Returns a pointer to the tracked object. + Smart pointer member access. Returns a pointer to the tracked object. If the internal pointer is @NULL this method will cause an assert in debug mode. */ - T* operator-(); + T* operator->(); /** Releases the currently tracked object and starts tracking @e pobj.