]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/scopedptr.tex
docs
[wxWidgets.git] / docs / latex / wx / scopedptr.tex
1 \section{\class{wxScopedPtr<T>}}\label{wxscopedptrtemplate}
2
3 A scoped pointer template class. It is the template version of
4 the old-style \helpref{scoped pointer macros}{wxscopedptr}.
5
6 \wxheading{Derived from}
7
8 No base class
9
10 \wxheading{Include files}
11
12 <ptr\_scpd.h>
13
14 \wxheading{Data structures}
15
16 {\small%
17 \begin{verbatim}
18 typedef T element_type
19 \end{verbatim}
20 }%
21
22 \wxheading{See also}
23
24 \helpref{wxSharedPtr}{wxsharedptr}, \helpref{wxWeakRef}{wxweakref}
25
26
27 \latexignore{\rtfignore{\wxheading{Members}}}
28
29 \membersection{wxScopedPtr<T>::wxScopedPtr<T>}\label{wxscopedptrtemplatewxscopedptrtemplate}
30
31 \func{wxEXPLICIT}{wxScopedPtr<T>}{\param{T * }{ptr = NULL}}
32
33 Constructor.
34
35 \membersection{wxScopedPtr<T>::\destruct{wxScopedPtr<T>}}\label{wxscopedptrtemplatedtor}
36
37 \func{}{\destruct{wxScopedPtr<T>}}{\void}
38
39 Destructor.
40
41 \membersection{wxScopedPtr<T>::get}\label{wxscopedptrtemplateget}
42
43 \constfunc{T *}{get}{\void}
44
45 Returns pointer to object or NULL.
46
47 \membersection{wxScopedPtr<T>::operator*}\label{wxscopedptrtemplateoperatorreft}
48
49 \constfunc{T \&}{operator*}{\void}
50
51 Returns a reference to the object. If the internal pointer is NULL
52 this method will cause an assert in debug mode.
53
54 \membersection{wxScopedPtr<T>::operator->}\label{wxscopedptrtemplateoperatorderef}
55
56 \constfunc{T *}{operator->}{\void}
57
58 Returns pointer to object. If the pointer is NULL this method will
59 cause an assert in debug mode.
60
61 \membersection{wxScopedPtr<T>::release}\label{wxscopedptrtemplaterelease}
62
63 \func{T*}{release}{\void}
64
65 Releases the current pointer and returns it.
66
67 \membersection{wxScopedPtr<T>::reset}\label{wxscopedptrtemplatereset}
68
69 \func{void}{reset}{\param{T * }{ptr = NULL}}
70
71 Reset pointer. Afterwards the caller is responsible for deleting
72 the data contained in the scoped pointer before.
73
74 \membersection{wxScopedPtr<T>::swap}\label{wxscopedptrtemplateswap}
75
76 \func{void}{swap}{\param{wxScopedPtr<T> \& }{ot}}
77
78 Swaps pointers.
79