// 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
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.