source: trunk/doc/html/qmapiterator.html

Last change on this file was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 9.7 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/doc/qmap.doc:604 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>QMapIterator Class</title>
7<style type="text/css"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { background: #ffffff; color: black; }
12--></style>
13</head>
14<body>
15
16<table border="0" cellpadding="0" cellspacing="0" width="100%">
17<tr bgcolor="#E5E5E5">
18<td valign=center>
19 <a href="index.html">
20<font color="#004faf">Home</font></a>
21 | <a href="classes.html">
22<font color="#004faf">All&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;Classes</font></a>
25 | <a href="annotated.html">
26<font color="#004faf">Annotated</font></a>
27 | <a href="groups.html">
28<font color="#004faf">Grouped&nbsp;Classes</font></a>
29 | <a href="functions.html">
30<font color="#004faf">Functions</font></a>
31</td>
32<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QMapIterator Class Reference</h1>
33
34<p>The QMapIterator class provides an iterator for QMap.
35<a href="#details">More...</a>
36<p><tt>#include &lt;<a href="qmap-h.html">qmap.h</a>&gt;</tt>
37<p><a href="qmapiterator-members.html">List of all member functions.</a>
38<h2>Public Members</h2>
39<ul>
40<li class=fn>typedef std::bidirectional_iterator_tag&nbsp;<a href="#iterator_category"><b>iterator_category</b></a></li>
41<li class=fn>typedef T&nbsp;<a href="#value_type"><b>value_type</b></a></li>
42<li class=fn>typedef T&nbsp;*&nbsp;<a href="#pointer"><b>pointer</b></a></li>
43<li class=fn>typedef T&nbsp;&amp;&nbsp;<a href="#reference"><b>reference</b></a></li>
44<li class=fn><a href="#QMapIterator"><b>QMapIterator</b></a> ()</li>
45<li class=fn><a href="#QMapIterator-2"><b>QMapIterator</b></a> ( QMapNode&lt;K,&nbsp;T&gt;&nbsp;*&nbsp;p )</li>
46<li class=fn><a href="#QMapIterator-3"><b>QMapIterator</b></a> ( const&nbsp;QMapIterator&lt;K,&nbsp;T&gt;&nbsp;&amp;&nbsp;it )</li>
47<li class=fn>bool <a href="#operator-eq-eq"><b>operator==</b></a> ( const&nbsp;QMapIterator&lt;K,&nbsp;T&gt;&nbsp;&amp;&nbsp;it ) const</li>
48<li class=fn>bool <a href="#operator!-eq"><b>operator!=</b></a> ( const&nbsp;QMapIterator&lt;K,&nbsp;T&gt;&nbsp;&amp;&nbsp;it ) const</li>
49<li class=fn>T &amp; <a href="#operator*"><b>operator*</b></a> ()</li>
50<li class=fn>const T &amp; <a href="#operator*-2"><b>operator*</b></a> () const</li>
51<li class=fn>const K &amp; <a href="#key"><b>key</b></a> () const</li>
52<li class=fn>T &amp; <a href="#data"><b>data</b></a> ()</li>
53<li class=fn>const T &amp; <a href="#data-2"><b>data</b></a> () const</li>
54<li class=fn>QMapIterator&lt;K, T&gt; &amp; <a href="#operator++"><b>operator++</b></a> ()</li>
55<li class=fn>QMapIterator&lt;K, T&gt; <a href="#operator++-2"><b>operator++</b></a> ( int )</li>
56<li class=fn>QMapIterator&lt;K, T&gt; &amp; <a href="#operator--"><b>operator--</b></a> ()</li>
57<li class=fn>QMapIterator&lt;K, T&gt; <a href="#operator---2"><b>operator--</b></a> ( int )</li>
58</ul>
59<hr><a name="details"></a><h2>Detailed Description</h2>
60
61
62The QMapIterator class provides an iterator for <a href="qmap.html">QMap</a>.
63<p>
64
65<p> You cannot create an iterator by yourself. Instead, you must ask a
66map to give you one. An iterator is as big as a pointer; on 32-bit
67machines that means 4 bytes, on 64-bit machines, 8 bytes. That
68makes copying iterators very fast. Iterators behave in a similar
69way to pointers, and they are almost as fast as pointers. See the
70<a href="qmap.html#qmap-eg">QMap example</a>.
71<p> QMap is highly optimized for performance and memory usage, but the
72trade-off is that you must be more careful. The only way to
73traverse a map is to use iterators. QMap does not know about its
74iterators, and the iterators don't even know to which map they
75belong. That makes things fast but a bit dangerous because it is
76up to you to make sure that the iterators you are using are still
77valid. <a href="qdictiterator.html">QDictIterator</a> will be able to give warnings, whereas
78QMapIterator may end up in an undefined state.
79<p> For every Iterator there is also a ConstIterator. You must use the
80ConstIterator to access a <a href="qmap.html">QMap</a> in a const environment or if the
81reference or pointer to the map is itself const. Its semantics are
82the same, but it only returns const references to the item it
83points to.
84<p> <p>See also <a href="qmap.html">QMap</a>, <a href="qmapconstiterator.html">QMapConstIterator</a>, <a href="qtl.html">Qt Template Library Classes</a>, and <a href="tools.html">Non-GUI Classes</a>.
85
86<hr><h2>Member Type Documentation</h2>
87<h3 class=fn><a name="iterator_category"></a>QMapIterator::iterator_category</h3>
88The type of iterator category, <tt>std::bidirectional_iterator_tag</tt>.
89<h3 class=fn><a name="pointer"></a>QMapIterator::pointer</h3>
90Pointer to value_type.
91<h3 class=fn><a name="reference"></a>QMapIterator::reference</h3>
92Reference to value_type.
93<h3 class=fn><a name="value_type"></a>QMapIterator::value_type</h3>
94The type of value.
95<hr><h2>Member Function Documentation</h2>
96<h3 class=fn><a name="QMapIterator"></a>QMapIterator::QMapIterator ()
97</h3>
98
99<p> Creates an uninitialized iterator.
100
101<h3 class=fn><a name="QMapIterator-2"></a>QMapIterator::QMapIterator ( QMapNode&lt;K,&nbsp;T&gt;&nbsp;*&nbsp;p )
102</h3>
103
104<p> Constructs an iterator starting at node <em>p</em>.
105
106<h3 class=fn><a name="QMapIterator-3"></a>QMapIterator::QMapIterator ( const&nbsp;<a href="qmapiterator.html">QMapIterator</a>&lt;K,&nbsp;T&gt;&nbsp;&amp;&nbsp;it )
107</h3>
108
109<p> Constructs a copy of the iterator, <em>it</em>.
110
111<h3 class=fn>T &amp; <a name="data"></a>QMapIterator::data ()
112</h3>
113
114<p> Returns a reference to the current item's data.
115
116<h3 class=fn>const T &amp; <a name="data-2"></a>QMapIterator::data () const
117</h3>
118
119<p> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
120<p> Returns a const reference to the current item's data.
121
122<h3 class=fn>const K &amp; <a name="key"></a>QMapIterator::key () const
123</h3>
124
125<p> Returns a const reference to the current item's key.
126
127<h3 class=fn>bool <a name="operator!-eq"></a>QMapIterator::operator!= ( const&nbsp;<a href="qmapiterator.html">QMapIterator</a>&lt;K,&nbsp;T&gt;&nbsp;&amp;&nbsp;it ) const
128</h3>
129
130<p> Compares the iterator to the <em>it</em> iterator and returns FALSE if
131they point to the same item; otherwise returns TRUE.
132
133<h3 class=fn>T &amp; <a name="operator*"></a>QMapIterator::operator* ()
134</h3>
135
136<p> Dereference operator. Returns a reference to the current item's
137data. The same as <a href="#data">data</a>().
138
139<h3 class=fn>const T &amp; <a name="operator*-2"></a>QMapIterator::operator* () const
140</h3>
141
142<p> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
143<p> Dereference operator. Returns a const reference to the current
144item's data. The same as <a href="#data">data</a>().
145
146<h3 class=fn><a href="qmapiterator.html">QMapIterator</a>&lt;K,&nbsp;T&gt;&nbsp;&amp; <a name="operator++"></a>QMapIterator::operator++ ()
147</h3>
148
149<p> Prefix ++ makes the succeeding item current and returns an
150iterator pointing to the new current item. The iterator cannot
151check whether it reached the end of the map. Incrementing the
152iterator returned by end() causes undefined results.
153
154<h3 class=fn><a href="qmapiterator.html">QMapIterator</a>&lt;K,&nbsp;T&gt; <a name="operator++-2"></a>QMapIterator::operator++ ( int )
155</h3>
156
157<p> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
158<p> Postfix ++ makes the succeeding item current and returns an
159iterator pointing to the new current item. The iterator cannot
160check whether it reached the end of the map. Incrementing the
161iterator returned by end() causes undefined results.
162
163<h3 class=fn><a href="qmapiterator.html">QMapIterator</a>&lt;K,&nbsp;T&gt;&nbsp;&amp; <a name="operator--"></a>QMapIterator::operator-- ()
164</h3>
165
166<p> Prefix -- makes the previous item current and returns an iterator
167pointing to the new current item. The iterator cannot check
168whether it reached the beginning of the map. Decrementing the
169iterator returned by begin() causes undefined results.
170
171<h3 class=fn><a href="qmapiterator.html">QMapIterator</a>&lt;K,&nbsp;T&gt; <a name="operator---2"></a>QMapIterator::operator-- ( int )
172</h3>
173
174<p> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
175<p> Postfix -- makes the previous item current and returns an iterator
176pointing to the new current item. The iterator cannot check
177whether it reached the beginning of the map. Decrementing the
178iterator returned by begin() causes undefined results.
179
180<h3 class=fn>bool <a name="operator-eq-eq"></a>QMapIterator::operator== ( const&nbsp;<a href="qmapiterator.html">QMapIterator</a>&lt;K,&nbsp;T&gt;&nbsp;&amp;&nbsp;it ) const
181</h3>
182
183<p> Compares the iterator to the <em>it</em> iterator and returns TRUE if
184they point to the same item; otherwise returns FALSE.
185
186<!-- eof -->
187<hr><p>
188This file is part of the <a href="index.html">Qt toolkit</a>.
189Copyright &copy; 1995-2007
190<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
191<table width=100% cellspacing=0 border=0><tr>
192<td>Copyright &copy; 2007
193<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
194<td align=right><div align=right>Qt 3.3.8</div>
195</table></div></address></body>
196</html>
Note: See TracBrowser for help on using the repository browser.