]> git.saurik.com Git - wxWidgets.git/blob - interface/vector.h
replace @seealso with @see; as Vaclav pointed out we shouldn't use custom aliases...
[wxWidgets.git] / interface / vector.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: vector.h
3 // Purpose: interface of wxVector<T>
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 @see @ref overview_wxcontaineroverview, wxListT(), wxArrayT()
25 */
26 class wxVector<T>
27 {
28 public:
29 //@{
30 /**
31 Constructor.
32 */
33 wxVectorT();
34 wxVectorT(const wxVector<T>& c);
35 //@}
36
37 /**
38 Destructor.
39 */
40 ~wxVectorT();
41
42 //@{
43 /**
44 Returns item at position @e idx.
45 */
46 const value_type at(size_type idx);
47 const value_type at(size_type idx);
48 //@}
49
50 //@{
51 /**
52 Return last item.
53 */
54 const value_type back();
55 const value_type back();
56 //@}
57
58 //@{
59 /**
60 Return iterator to beginning of the vector.
61 */
62 const_iterator begin();
63 const iterator begin();
64 //@}
65
66 /**
67
68 */
69 size_type capacity() const;
70
71 /**
72 Clears the vector.
73 */
74 void clear();
75
76 /**
77 Returns @true if the vector is empty.
78 */
79 bool empty() const;
80
81 //@{
82 /**
83 Returns iterator to the end of the vector.
84 */
85 const_iterator end();
86 const iterator end();
87 //@}
88
89 //@{
90 /**
91 Erase items. When using values other than built-in integrals
92 or classes with reference counting this can be an inefficient
93 operation.
94 */
95 iterator erase(iterator it);
96 iterator erase(iterator first, iterator last);
97 //@}
98
99 //@{
100 /**
101 Returns first item.
102 */
103 const value_type front();
104 const value_type front();
105 //@}
106
107 /**
108 )
109 Insert an item. When using values other than built-in integrals
110 or classes with reference counting this can be an inefficient
111 operation.
112 */
113 iterator insert(iterator it);
114
115 /**
116 Assignment operator.
117 */
118 wxVectorT& operator operator=(const wxVector<T>& vb);
119
120 //@{
121 /**
122 Returns item at position @e idx.
123 */
124 const value_type operator[](size_type idx);
125 const value_type operator[](size_type idx);
126 //@}
127
128 /**
129 Removes the last item.
130 */
131 void pop_back();
132
133 /**
134 Adds an item to the end of the vector.
135 */
136 void push_back(const value_type& v);
137
138 /**
139 Reserves more memory of @a n is greater then
140 wxVector::size. Other this call has
141 no effect.
142 */
143 void reserve(size_type n);
144 };
145