1 \section{\class{wxSharedPtr<T>
}}\label{wxsharedptr
}
3 A smart pointer with non-intrusive reference counting. It is modeled
4 after
{\bf boost::shared
\_ptr<>
} and can be used with STL containers
5 and
\helpref{wxVector<>
}{wxvector
} - unlike
{\bf std::auto
\_ptr<>
}
6 and
\helpref{wxScopedPtr<>
}{wxscopedptrtemplate
}.
8 \wxheading{Derived from
}
12 \wxheading{Include files
}
16 \wxheading{Data structures
}
20 typedef T element_type
26 \helpref{wxScopedPtr
}{wxscopedptrtemplate
},
\helpref{wxWeakRef
}{wxweakref
}
29 \latexignore{\rtfignore{\wxheading{Members
}}}
32 \membersection{wxSharedPtr<T>::wxSharedPtr<T>
}\label{wxsharedptrwxsharedptr
}
34 \func{wxEXPLICIT
}{wxSharedPtr<T>
}{\param{T*
}{ptr = NULL
}}
36 \func{}{wxSharedPtr<T>
}{\param{const wxSharedPtr<T>\&
}{tocopy
}}
40 \membersection{wxSharedPtr<T>::
\destruct{wxSharedPtr<T>
}}\label{wxsharedptrdtor
}
42 \func{}{\destruct{wxSharedPtr<T>
}}{\void}
46 \membersection{wxSharedPtr<T>::get
}\label{wxsharedptrget
}
48 \constfunc{T*
}{get
}{\void}
50 Returns pointer to its object or NULL.
52 \membersection{wxSharedPtr<T>::operator*
}\label{wxsharedptroperatorreft
}
54 \constfunc{T\&
}{operator*
}{\void}
56 Returns a reference to the object. If the internal pointer is NULL this
57 method will cause an assert in debug mode.
59 \membersection{wxSharedPtr<T>::operator->
}\label{wxsharedptroperatorderef
}
61 \constfunc{T*
}{operator->
}{\void}
63 Returns pointer to its object or NULL.
65 \membersection{wxSharedPtr<T>::operator=
}\label{wxsharedptroperatorassign
}
67 \func{wxSharedPtr<T>\& operator
}{operator=
}{\param{const wxSharedPtr<T>\&
}{tocopy
}}
69 Assignment operator. Releases any previously held pointer
70 and creates a reference to same object as
{\it topcopy
}.
72 \membersection{wxSharedPtr<T>::operator=
}\label{wxsharedptroperatorassign2
}
74 \func{wxSharedPtr<T>\& operator
}{operator=
}{\param{T *
}{ptr
}}
76 Assignment operator. Releases any previously held pointer
77 and creates a reference to
{\it ptr
}.
79 \membersection{wxSharedPtr<T>::unique
}\label{wxsharedptrunique
}
81 \constfunc{bool
}{unique
}{\void}
83 Returns true if this is the only pointer pointing to its object.
85 \membersection{wxSharedPtr<T>::use
\_count}\label{wxsharedptruse
\_count}
87 \constfunc{long
}{use
\_count}{\void}
89 Returns the number of pointers pointing to its object.
91 \membersection{wxSharedPtr<T>::reset
}\label{wxsharedptrreset
}
93 \func{void
}{reset
}{\param{T *
}{ptr = NULL
}}
95 Reset pointer to
{\it ptr
}. Afterwards the caller is responsible
96 for deleting the data contained in the pointer before.