]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/sharedptr.tex
Updated wxWeakRef<T> to patch Weak references for wx - part 2, removed T*() and added...
[wxWidgets.git] / docs / latex / wx / sharedptr.tex
1 \section{\class{wxSharedPtr<T>}}\label{wxsharedptr}
2
3 A smart pointer with non-intrusive reference counting.
4
5 \wxheading{Derived from}
6
7 No base class
8
9 \wxheading{Include files}
10
11 <ptr\_shrd.h>
12
13 \wxheading{Data structures}
14
15 {\small%
16 \begin{verbatim}
17 typedef T element_type
18 \end{verbatim}
19 }%
20
21 \latexignore{\rtfignore{\wxheading{Members}}}
22
23
24 \membersection{wxSharedPtr<T>::wxSharedPtr<T>}\label{wxsharedptrwxsharedptr}
25
26 \func{wxEXPLICIT}{wxSharedPtr<T>}{\param{T* }{ptr = NULL}}
27
28 \func{}{wxSharedPtr<T>}{\param{const wxSharedPtr<T>\& }{tocopy}}
29
30 Constructors.
31
32 \membersection{wxSharedPtr<T>::\destruct{wxSharedPtr<T>}}\label{wxsharedptrdtor}
33
34 \func{}{\destruct{wxSharedPtr<T>}}{\void}
35
36 Destructor.
37
38 \membersection{wxSharedPtr<T>::get}\label{wxsharedptrget}
39
40 \constfunc{T*}{get}{\void}
41
42 Returns pointer to its object or NULL.
43
44 \membersection{wxSharedPtr<T>::operator*}\label{wxsharedptroperatorreft}
45
46 \constfunc{T\&}{operator*}{\void}
47
48 Returns a reference to the object. If the internal pointer is NULL this
49 method will cause an assert in debug mode.
50
51 \membersection{wxSharedPtr<T>::operator->}\label{wxsharedptroperatorderef}
52
53 \constfunc{T*}{operator->}{\void}
54
55 Returns pointer to its object or NULL.
56
57 \membersection{wxSharedPtr<T>::operator=}\label{wxsharedptroperatorassign}
58
59 \func{wxSharedPtr<T>\& operator}{operator=}{\param{const wxSharedPtr<T>\& }{tocopy}}
60
61 Assignment operator.
62
63 \membersection{wxSharedPtr<T>::unique}\label{wxsharedptrunique}
64
65 \constfunc{bool}{unique}{\void}
66
67 Returns true if this is the only pointer pointing to its object.
68
69 \membersection{wxSharedPtr<T>::use\_count}\label{wxsharedptruse\_count}
70
71 \constfunc{long}{use\_count}{\void}
72
73 Returns the number of pointers pointing to its object.
74
75 \membersection{wxSharedPtr<T>::reset}\label{wxsharedptrreset}
76
77 \func{void}{reset}{\param{T * }{ptr = NULL}}
78
79 Reset pointer to {\it ptr}. Afterwards the caller is responsible
80 for deleting the data contained in the pointer before.
81