]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/vector.tex
add wxVector docs
[wxWidgets.git] / docs / latex / wx / vector.tex
1 \section{\class{wxVector<T>}}\label{wxvector}
2
3 wxVector is a template which implements most of the std::vector
4 class and can be used like. If wxWidgets is compiled in STL mode,
5 wxVector will just be a typedef to std::vector. You should
6 refer to the STL documentation for further information.
7
8 \wxheading{Derived from}
9
10 No base class
11
12 \wxheading{Include files}
13
14 <vector.h>
15
16 \wxheading{See also}
17
18 \helpref{Container classes overview}{wxcontaineroverview},
19 \helpref{wxList<T>}{wxlist},
20 \helpref{wxArray<T>}{wxvector}
21
22 \membersection{wxVector<T>::wxVector<T>}\label{wxvectorwxvector}
23
24 \func{}{wxVector<T>}{\void}
25
26 \func{}{wxVector<T>}{\param{const wxVector<T>\& }{c}}
27
28 Constructor.
29
30 \membersection{wxVector<T>::\destruct{wxVector<T>}}\label{wxvectordtor}
31
32 \func{}{\destruct{wxVector<T>}}{\void}
33
34 Destructor.
35
36 \membersection{wxVector<T>::operator=}\label{wxvectoroperatorassign}
37
38 \func{wxVector<T>\& operator}{operator=}{\param{const wxVector<T>\& }{vb}}
39
40 Assignement operator.
41
42 \membersection{wxVector<T>::at}\label{wxvectorat}
43
44 \constfunc{const value\_type\&}{at}{\param{size\_type }{idx}}
45
46 \func{value\_type\&}{at}{\param{size\_type }{idx}}
47
48 Returns item at position {\it idx}.
49
50 \membersection{wxVector<T>::back}\label{wxvectorback}
51
52 \constfunc{const value\_type\&}{back}{\void}
53
54 \func{value\_type\&}{back}{\void}
55
56 Return last item.
57
58 \membersection{wxVector<T>::begin}\label{wxvectorbegin}
59
60 \constfunc{const\_iterator}{begin}{\void}
61
62 \func{iterator}{begin}{\void}
63
64 Return iterator to beginning of the vector.
65
66 \membersection{wxVector<T>::capacity}\label{wxvectorcapacity}
67
68 \constfunc{size\_type}{capacity}{\void}
69
70
71 \membersection{wxVector<T>::clear}\label{wxvectorclear}
72
73 \func{void}{clear}{\void}
74
75 Clears the vector.
76
77 \membersection{wxVector<T>::empty}\label{wxvectorempty}
78
79 \constfunc{bool}{empty}{\void}
80
81 Returns true if the vector is empty.
82
83 \membersection{wxVector<T>::end}\label{wxvectorend}
84
85 \constfunc{const\_iterator}{end}{\void}
86
87 \func{iterator}{end}{\void}
88
89 Returns iterator to the end of the vector.
90
91 \membersection{wxVector<T>::erase}\label{wxvectorerase}
92
93 \func{iterator}{erase}{\param{iterator }{it}}
94
95 \func{iterator}{erase}{\param{iterator }{first}, \param{iterator }{last}}
96
97 Erase items.
98
99 \membersection{wxVector<T>::front}\label{wxvectorfront}
100
101 \constfunc{const value\_type\&}{front}{\void}
102
103 \func{value\_type\&}{front}{\void}
104
105 Returns first item.
106
107 \membersection{wxVector<T>::insert}\label{wxvectorinsert}
108
109 \func{iterator}{insert}{\param{iterator }{it}, \param{const value\_type\& }{v = value\_type()}}
110
111 Insert an item. When using values other than built-in integrals
112 or classes with reference counting this can be a very inefficient
113 operation.
114
115 \membersection{wxVector<T>::operator[]}\label{wxvectoroperatorunknown}
116
117 \constfunc{const value\_type\&}{operator[]}{\param{size\_type }{idx}}
118
119 \func{value\_type\&}{operator[]}{\param{size\_type }{idx}}
120
121 Returns item at position {\it idx}.
122
123 \membersection{wxVector<T>::pop\_back}\label{wxvectorpopback}
124
125 \func{void}{pop\_back}{\void}
126
127 Removes the last item.
128
129 \membersection{wxVector<T>::push\_back}\label{wxvectorpushback}
130
131 \func{void}{push\_back}{\param{const value\_type\& }{v}}
132
133 Adds an item to the end of the vector.
134
135 \membersection{wxVector<T>::reserve}\label{wxvectorreserve}
136
137 \func{void}{reserve}{\param{size\_type }{n}}
138
139 Reserves more memory of {\it n} is greater then
140 \helpref{size}{wxvectorsize}. Other this call has
141 no effect.
142
143 \membersection{wxVector<T>::size}\label{wxvectorsize}
144
145 \constfunc{size\_type}{size}{\void}
146
147 Returns the size of the vector.