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