X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d9a092733d3a7a904b4122632a8cfe88388254f3..7344108e8a129a3f9b4df5ab0f98a1713db03b89:/interface/wx/weakref.h?ds=inline diff --git a/interface/wx/weakref.h b/interface/wx/weakref.h index d208d48804..bf79582c7e 100644 --- a/interface/wx/weakref.h +++ b/interface/wx/weakref.h @@ -3,12 +3,11 @@ // Purpose: interface of wxWeakRefDynamic, wxWeakRef // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** - 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 @@ -19,7 +18,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,7 +27,7 @@ For API documentation, see: wxWeakRef. @tparam T - @todo docme + The type to which the smart pointer points to. @nolibrary @category{smartpointers} @@ -92,7 +91,7 @@ public: @endcode @tparam T - @todo docme + The type to which the smart pointer points to. @nolibrary @category{smartpointers} @@ -103,6 +102,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. */ @@ -116,7 +118,7 @@ public: /** Destructor. */ - ~wxWeakRef(); + virtual ~wxWeakRef(); /** Called when the tracked object is destroyed. Be default sets @@ -154,11 +156,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.