]> git.saurik.com Git - wxWidgets.git/blob - interface/vector.h
wxUniv compilation fix for gs_windowHandles assignment
[wxWidgets.git] / interface / vector.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: vector.h
3 // Purpose: documentation for wxVector<T> class
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxVectorT
11 @wxheader{vector.h}
12
13 wxVectorT is a template class which implements most of the std::vector
14 class and can be used like it. If wxWidgets is compiled in STL mode,
15 wxVector will just be a typedef to std::vector. Just like for std::vector,
16 objects stored in wxVectorT need to be @e assignable but don't have to
17 be @e default constructible.
18
19 You can refer to the STL documentation for further information.
20
21 @library{wxbase}
22 @category{FIXME}
23
24 @seealso
25 @ref overview_wxcontaineroverview "Container classes overview", wxListT,
26 wxArrayT
27 */
28 class wxVector<T>
29 {
30 public:
31 //@{
32 /**
33 Constructor.
34 */
35 wxVectorT();
36 wxVectorT(const wxVector<T>& c);
37 //@}
38
39 /**
40 Destructor.
41 */
42 ~wxVectorT();
43
44 //@{
45 /**
46 Returns item at position @e idx.
47 */
48 const value_type at(size_type idx);
49 value_type at(size_type idx);
50 //@}
51
52 //@{
53 /**
54 Return last item.
55 */
56 const value_type back();
57 value_type back();
58 //@}
59
60 //@{
61 /**
62 Return iterator to beginning of the vector.
63 */
64 const_iterator begin();
65 iterator begin();
66 //@}
67
68 /**
69
70 */
71 size_type capacity();
72
73 /**
74 Clears the vector.
75 */
76 void clear();
77
78 /**
79 Returns @true if the vector is empty.
80 */
81 bool empty();
82
83 //@{
84 /**
85 Returns iterator to the end of the vector.
86 */
87 const_iterator end();
88 iterator end();
89 //@}
90
91 //@{
92 /**
93 Erase items. When using values other than built-in integrals
94 or classes with reference counting this can be an inefficient
95 operation.
96 */
97 iterator erase(iterator it);
98 iterator erase(iterator first, iterator last);
99 //@}
100
101 //@{
102 /**
103 Returns first item.
104 */
105 const value_type front();
106 value_type front();
107 //@}
108
109 /**
110 )
111
112 Insert an item. When using values other than built-in integrals
113 or classes with reference counting this can be an inefficient
114 operation.
115 */
116 iterator insert(iterator it);
117
118 /**
119 Assignment operator.
120 */
121 wxVectorT& operator operator=(const wxVector<T>& vb);
122
123 //@{
124 /**
125 Returns item at position @e idx.
126 */
127 const value_type operator[](size_type idx);
128 value_type operator[](size_type idx);
129 //@}
130
131 /**
132 Removes the last item.
133 */
134 void pop_back();
135
136 /**
137 Adds an item to the end of the vector.
138 */
139 void push_back(const value_type& v);
140
141 /**
142 Reserves more memory of @e n is greater then
143 wxVector::size. Other this call has
144 no effect.
145 */
146 void reserve(size_type n);
147 };