X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0155f1644a4591b5d8ad7207f8eab513d25aa8ed..d5706f3ee8a83947a639ff44a21df29c97b72682:/docs/latex/wx/sharedptr.tex diff --git a/docs/latex/wx/sharedptr.tex b/docs/latex/wx/sharedptr.tex index 31f4ae9a5c..ac6400c13a 100644 --- a/docs/latex/wx/sharedptr.tex +++ b/docs/latex/wx/sharedptr.tex @@ -1,6 +1,9 @@ \section{\class{wxSharedPtr}}\label{wxsharedptr} -A smart pointer with non-intrusive reference counting. +A smart pointer with non-intrusive reference counting. It is modeled +after {\bf boost::shared\_ptr<>} and can be used with STL containers +and \helpref{wxVector<>}{wxvector} - unlike {\bf std::auto\_ptr<>} +and \helpref{wxScopedPtr<>}{wxscopedptrtemplate}. \wxheading{Derived from} @@ -18,6 +21,12 @@ typedef T element_type \end{verbatim} }% +\wxheading{See also} + +\helpref{wxScopedPtr}{wxscopedptrtemplate}, \helpref{wxWeakRef}{wxweakref}, +\helpref{wxObjectDataPtr}{wxobjectdataptr} + + \latexignore{\rtfignore{\wxheading{Members}}} @@ -41,11 +50,21 @@ Destructor. Returns pointer to its object or NULL. -\membersection{wxSharedPtr::operator*}\label{wxsharedptroperatorptrt} +\membersection{wxSharedPtr::operator unspecified\_bool\_type}\label{wxsharedptroperatorbool} + +\constfunc{}{operator unspecified\_bool\_type}{\void} + +Conversion to a boolean expression (in a variant which is not +convertable to anything but a boolean expression). If this class +contains a valid pointer it will return {\it true}, if it contains +a NULL pointer it will return {\it false}. + +\membersection{wxSharedPtr::operator*}\label{wxsharedptroperatorreft} \constfunc{T\&}{operator*}{\void} -Returns pointer to its object or NULL. +Returns a reference to the object. If the internal pointer is NULL this +method will cause an assert in debug mode. \membersection{wxSharedPtr::operator->}\label{wxsharedptroperatorderef} @@ -57,7 +76,15 @@ Returns pointer to its object or NULL. \func{wxSharedPtr\& operator}{operator=}{\param{const wxSharedPtr\& }{tocopy}} -Assignment operator. +Assignment operator. Releases any previously held pointer +and creates a reference to the same object as {\it topcopy}. + +\membersection{wxSharedPtr::operator=}\label{wxsharedptroperatorassign2} + +\func{wxSharedPtr\& operator}{operator=}{\param{T *}{ptr}} + +Assignment operator. Releases any previously held pointer +and creates a reference to {\it ptr}. \membersection{wxSharedPtr::unique}\label{wxsharedptrunique} @@ -71,3 +98,10 @@ Returns true if this is the only pointer pointing to its object. Returns the number of pointers pointing to its object. +\membersection{wxSharedPtr::reset}\label{wxsharedptrreset} + +\func{void}{reset}{\param{T * }{ptr = NULL}} + +Reset pointer to {\it ptr}. If the reference count of the +previously owned pointer was 1 it will be deleted. +