improvements to wxWeakRef and related classes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51187 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-01-13 01:12:13 +00:00
parent 0fb0ecc452
commit cc6ceca789
12 changed files with 983 additions and 309 deletions

View File

@@ -0,0 +1,20 @@
\section{\class{wxWeakRefDynamic<T>}}\label{wxweakrefdynamic}
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 \texttt{dynamic\_cast<>} for establishing the object
reference (while wxWeakRef defaults to \texttt{static\_cast<>}).
So, wxWeakRef will detect a type mismatch during compile time and will
have a little better run-time performance. The role of wxWeakRefDynamic
is to handle objects which derived type one does not know.
\textbf{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-
mode operation, where it uses \texttt{dynamic\_cast<>} as the last measure (if
available from the compiler and enabled when building wxWidgets).
For general cases, wxWeakRef<T> is the better choice.
For API documentation, see: \helpref{wxWeakRef}{wxweakref}