// Purpose: interface of wxWeakRefDynamic<T>, wxWeakRef<T>
// Author: wxWidgets team
// RCS-ID: $Id$
-// Licence: wxWindows license
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
/**
- @class wxWeakRefDynamic<T>
-
wxWeakRefDynamic<T> is a template class for weak references that is used in
the same way as wxWeakRef<T>. The only difference is that wxWeakRefDynamic
defaults to using @c dynamic_cast for establishing the object reference
is to handle objects which derived type one does not know.
@note wxWeakRef<T> 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).
For API documentation, see: wxWeakRef<T>.
+ @tparam T
+ The type to which the smart pointer points to.
+
@nolibrary
- @category{misc}
+ @category{smartpointers}
*/
template<typename T>
class wxWeakRefDynamic<T>
/**
- @class wxWeakRef<T>
-
wxWeakRef<T> 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
typedef wxWeakRef<wxWindow> wxWindowRef;
@endcode
+ @tparam T
+ The type to which the smart pointer points to.
+
@nolibrary
- @category{misc}
+ @category{smartpointers}
@see wxSharedPtr<T>, wxScopedPtr<T>
*/
class wxWeakRef<T> : public wxTrackerNode
{
public:
+ /// Type of the element stored by this reference.
+ typedef T element_type;
+
/**
Constructor. The weak reference is initialized to @e pobj.
*/
/**
Destructor.
*/
- ~wxWeakRef();
+ virtual ~wxWeakRef();
/**
Called when the tracked object is destroyed. Be default sets
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.