source: trunk/doc/html/qcacheiterator.html@ 203

Last change on this file since 203 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/qcache.doc:293 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>QCacheIterator 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>QCacheIterator Class Reference</h1>
33
34<p>The QCacheIterator class provides an iterator for QCache collections.
35<a href="#details">More...</a>
36<p><tt>#include &lt;<a href="qcache-h.html">qcache.h</a>&gt;</tt>
37<p><a href="qcacheiterator-members.html">List of all member functions.</a>
38<h2>Public Members</h2>
39<ul>
40<li class=fn><a href="#QCacheIterator"><b>QCacheIterator</b></a> ( const&nbsp;QCache&lt;type&gt;&nbsp;&amp;&nbsp;cache )</li>
41<li class=fn><a href="#QCacheIterator-2"><b>QCacheIterator</b></a> ( const&nbsp;QCacheIterator&lt;type&gt;&nbsp;&amp;&nbsp;ci )</li>
42<li class=fn>QCacheIterator&lt;type&gt; &amp; <a href="#operator-eq"><b>operator=</b></a> ( const&nbsp;QCacheIterator&lt;type&gt;&nbsp;&amp;&nbsp;ci )</li>
43<li class=fn>uint <a href="#count"><b>count</b></a> () const</li>
44<li class=fn>bool <a href="#isEmpty"><b>isEmpty</b></a> () const</li>
45<li class=fn>bool <a href="#atFirst"><b>atFirst</b></a> () const</li>
46<li class=fn>bool <a href="#atLast"><b>atLast</b></a> () const</li>
47<li class=fn>type * <a href="#toFirst"><b>toFirst</b></a> ()</li>
48<li class=fn>type * <a href="#toLast"><b>toLast</b></a> ()</li>
49<li class=fn><a href="#operator-type-*"><b>operator type *</b></a> () const</li>
50<li class=fn>type * <a href="#current"><b>current</b></a> () const</li>
51<li class=fn>QString <a href="#currentKey"><b>currentKey</b></a> () const</li>
52<li class=fn>type * <a href="#operator()"><b>operator()</b></a> ()</li>
53<li class=fn>type * <a href="#operator++"><b>operator++</b></a> ()</li>
54<li class=fn>type * <a href="#operator+-eq"><b>operator+=</b></a> ( uint&nbsp;jump )</li>
55<li class=fn>type * <a href="#operator--"><b>operator--</b></a> ()</li>
56<li class=fn>type * <a href="#operator--eq"><b>operator-=</b></a> ( uint&nbsp;jump )</li>
57</ul>
58<hr><a name="details"></a><h2>Detailed Description</h2>
59
60
61The QCacheIterator class provides an iterator for <a href="qcache.html">QCache</a> collections.
62<p>
63
64<p> Note that the traversal order is arbitrary; you are not guaranteed
65any particular order. If new objects are inserted into the cache
66while the iterator is active, the iterator may or may not see
67them.
68<p> Multiple iterators are completely independent, even when they
69operate on the same QCache. QCache updates all iterators that
70refer an item when that item is removed.
71<p> QCacheIterator provides an <a href="#operator++">operator++</a>(), and an <a href="#operator+-eq">operator+=</a>() to
72traverse the cache. The <a href="#current">current</a>() and <a href="#currentKey">currentKey</a>() functions are
73used to access the current cache item and its key. The <a href="#atFirst">atFirst</a>()
74and <a href="#atLast">atLast</a>() return TRUE if the iterator points to the first or
75last item in the cache respectively. The <a href="#isEmpty">isEmpty</a>() function
76returns TRUE if the cache is empty, and <a href="#count">count</a>() returns the number
77of items in the cache.
78<p> Note that atFirst() and atLast() refer to the iterator's arbitrary
79ordering, not to the cache's internal least recently used list.
80<p> <p>See also <a href="qcache.html">QCache</a>, <a href="collection.html">Collection Classes</a>, and <a href="tools.html">Non-GUI Classes</a>.
81
82<hr><h2>Member Function Documentation</h2>
83<h3 class=fn><a name="QCacheIterator"></a>QCacheIterator::QCacheIterator ( const&nbsp;<a href="qcache.html">QCache</a>&lt;type&gt;&nbsp;&amp;&nbsp;cache )
84</h3>
85
86<p> Constructs an iterator for <em>cache</em>. The current iterator item is
87set to point to the first item in the <em>cache</em>.
88
89<h3 class=fn><a name="QCacheIterator-2"></a>QCacheIterator::QCacheIterator ( const&nbsp;<a href="qcacheiterator.html">QCacheIterator</a>&lt;type&gt;&nbsp;&amp;&nbsp;ci )
90</h3>
91
92<p> Constructs an iterator for the same cache as <em>ci</em>. The new
93iterator starts at the same item as ci.<a href="#current">current</a>(), but moves
94independently from there on.
95
96<h3 class=fn>bool <a name="atFirst"></a>QCacheIterator::atFirst () const
97</h3>
98
99<p> Returns TRUE if the iterator points to the first item in the
100cache; otherwise returns FALSE. Note that this refers to the
101iterator's arbitrary ordering, not to the cache's internal least
102recently used list.
103<p> <p>See also <a href="#toFirst">toFirst</a>() and <a href="#atLast">atLast</a>().
104
105<h3 class=fn>bool <a name="atLast"></a>QCacheIterator::atLast () const
106</h3>
107
108<p> Returns TRUE if the iterator points to the last item in the cache;
109otherwise returns FALSE. Note that this refers to the iterator's
110arbitrary ordering, not to the cache's internal least recently
111used list.
112<p> <p>See also <a href="#toLast">toLast</a>() and <a href="#atFirst">atFirst</a>().
113
114<h3 class=fn>uint <a name="count"></a>QCacheIterator::count () const
115</h3>
116
117<p> Returns the number of items in the cache on which this iterator
118operates.
119<p> <p>See also <a href="#isEmpty">isEmpty</a>().
120
121<h3 class=fn>type * <a name="current"></a>QCacheIterator::current () const
122</h3>
123
124<p> Returns a pointer to the current iterator item.
125
126<h3 class=fn><a href="qstring.html">QString</a> <a name="currentKey"></a>QCacheIterator::currentKey () const
127</h3>
128
129<p> Returns the key for the current iterator item.
130
131<h3 class=fn>bool <a name="isEmpty"></a>QCacheIterator::isEmpty () const
132</h3>
133
134<p> Returns TRUE if the cache is empty, i.e. <a href="#count">count</a>() == 0; otherwise
135it returns FALSE.
136<p> <p>See also <a href="#count">count</a>().
137
138<h3 class=fn><a name="operator-type-*"></a>QCacheIterator::operator type * () const
139</h3>
140
141<p> Cast operator. Returns a pointer to the current iterator item.
142Same as <a href="#current">current</a>().
143
144<h3 class=fn>type * <a name="operator()"></a>QCacheIterator::operator() ()
145</h3>
146
147<p> Makes the succeeding item current and returns the original current
148item.
149<p> If the current iterator item was the last item in the cache or if
150it was 0, 0 is returned.
151
152<h3 class=fn>type * <a name="operator++"></a>QCacheIterator::operator++ ()
153</h3>
154
155<p> Prefix++ makes the iterator point to the item just after <a href="#current">current</a>()
156and makes that the new current item for the iterator. If current()
157was the last item, <a href="#operator++">operator++</a>() returns 0.
158
159<h3 class=fn>type * <a name="operator+-eq"></a>QCacheIterator::operator+= ( uint&nbsp;jump )
160</h3>
161
162<p> Returns the item <em>jump</em> positions after the current item, or 0 if
163it is beyond the last item. Makes this the current item.
164
165<h3 class=fn>type * <a name="operator--"></a>QCacheIterator::operator-- ()
166</h3>
167
168<p> Prefix-- makes the iterator point to the item just before
169<a href="#current">current</a>() and makes that the new current item for the iterator. If
170current() was the first item, <a href="#operator--">operator--</a>() returns 0.
171
172<h3 class=fn>type * <a name="operator--eq"></a>QCacheIterator::operator-= ( uint&nbsp;jump )
173</h3>
174
175<p> Returns the item <em>jump</em> positions before the current item, or 0
176if it is before the first item. Makes this the current item.
177
178<h3 class=fn><a href="qcacheiterator.html">QCacheIterator</a>&lt;type&gt;&nbsp;&amp; <a name="operator-eq"></a>QCacheIterator::operator= ( const&nbsp;<a href="qcacheiterator.html">QCacheIterator</a>&lt;type&gt;&nbsp;&amp;&nbsp;ci )
179</h3>
180
181<p> Makes this an iterator for the same cache as <em>ci</em>. The new
182iterator starts at the same item as ci.<a href="#current">current</a>(), but moves
183independently thereafter.
184
185<h3 class=fn>type * <a name="toFirst"></a>QCacheIterator::toFirst ()
186</h3>
187
188<p> Sets the iterator to point to the first item in the cache and
189returns a pointer to the item.
190<p> Sets the iterator to 0 and returns 0 if the cache is empty.
191<p> <p>See also <a href="#toLast">toLast</a>() and <a href="#isEmpty">isEmpty</a>().
192
193<h3 class=fn>type * <a name="toLast"></a>QCacheIterator::toLast ()
194</h3>
195
196<p> Sets the iterator to point to the last item in the cache and
197returns a pointer to the item.
198<p> Sets the iterator to 0 and returns 0 if the cache is empty.
199<p> <p>See also <a href="#toFirst">toFirst</a>() and <a href="#isEmpty">isEmpty</a>().
200
201<!-- eof -->
202<hr><p>
203This file is part of the <a href="index.html">Qt toolkit</a>.
204Copyright &copy; 1995-2007
205<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
206<table width=100% cellspacing=0 border=0><tr>
207<td>Copyright &copy; 2007
208<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
209<td align=right><div align=right>Qt 3.3.8</div>
210</table></div></address></body>
211</html>
Note: See TracBrowser for help on using the repository browser.