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"><!--
|
---|
8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
9 | a:link { color: #004faf; text-decoration: none }
|
---|
10 | a:visited { color: #672967; text-decoration: none }
|
---|
11 | body { 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 Classes</font></a>
|
---|
23 | | <a href="mainclasses.html">
|
---|
24 | <font color="#004faf">Main 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 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 <<a href="qcache-h.html">qcache.h</a>></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 QCache<type> & cache )</li>
|
---|
41 | <li class=fn><a href="#QCacheIterator-2"><b>QCacheIterator</b></a> ( const QCacheIterator<type> & ci )</li>
|
---|
42 | <li class=fn>QCacheIterator<type> & <a href="#operator-eq"><b>operator=</b></a> ( const QCacheIterator<type> & 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 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 jump )</li>
|
---|
57 | </ul>
|
---|
58 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
59 |
|
---|
60 |
|
---|
61 | The 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
|
---|
65 | any particular order. If new objects are inserted into the cache
|
---|
66 | while the iterator is active, the iterator may or may not see
|
---|
67 | them.
|
---|
68 | <p> Multiple iterators are completely independent, even when they
|
---|
69 | operate on the same QCache. QCache updates all iterators that
|
---|
70 | refer 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
|
---|
72 | traverse the cache. The <a href="#current">current</a>() and <a href="#currentKey">currentKey</a>() functions are
|
---|
73 | used to access the current cache item and its key. The <a href="#atFirst">atFirst</a>()
|
---|
74 | and <a href="#atLast">atLast</a>() return TRUE if the iterator points to the first or
|
---|
75 | last item in the cache respectively. The <a href="#isEmpty">isEmpty</a>() function
|
---|
76 | returns TRUE if the cache is empty, and <a href="#count">count</a>() returns the number
|
---|
77 | of items in the cache.
|
---|
78 | <p> Note that atFirst() and atLast() refer to the iterator's arbitrary
|
---|
79 | ordering, 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 <a href="qcache.html">QCache</a><type> & cache )
|
---|
84 | </h3>
|
---|
85 |
|
---|
86 | <p> Constructs an iterator for <em>cache</em>. The current iterator item is
|
---|
87 | set to point to the first item in the <em>cache</em>.
|
---|
88 |
|
---|
89 | <h3 class=fn><a name="QCacheIterator-2"></a>QCacheIterator::QCacheIterator ( const <a href="qcacheiterator.html">QCacheIterator</a><type> & ci )
|
---|
90 | </h3>
|
---|
91 |
|
---|
92 | <p> Constructs an iterator for the same cache as <em>ci</em>. The new
|
---|
93 | iterator starts at the same item as ci.<a href="#current">current</a>(), but moves
|
---|
94 | independently 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
|
---|
100 | cache; otherwise returns FALSE. Note that this refers to the
|
---|
101 | iterator's arbitrary ordering, not to the cache's internal least
|
---|
102 | recently 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;
|
---|
109 | otherwise returns FALSE. Note that this refers to the iterator's
|
---|
110 | arbitrary ordering, not to the cache's internal least recently
|
---|
111 | used 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
|
---|
118 | operates.
|
---|
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
|
---|
135 | it 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.
|
---|
142 | Same 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
|
---|
148 | item.
|
---|
149 | <p> If the current iterator item was the last item in the cache or if
|
---|
150 | it 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>()
|
---|
156 | and makes that the new current item for the iterator. If current()
|
---|
157 | was the last item, <a href="#operator++">operator++</a>() returns 0.
|
---|
158 |
|
---|
159 | <h3 class=fn>type * <a name="operator+-eq"></a>QCacheIterator::operator+= ( uint jump )
|
---|
160 | </h3>
|
---|
161 |
|
---|
162 | <p> Returns the item <em>jump</em> positions after the current item, or 0 if
|
---|
163 | it 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
|
---|
170 | current() 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 jump )
|
---|
173 | </h3>
|
---|
174 |
|
---|
175 | <p> Returns the item <em>jump</em> positions before the current item, or 0
|
---|
176 | if it is before the first item. Makes this the current item.
|
---|
177 |
|
---|
178 | <h3 class=fn><a href="qcacheiterator.html">QCacheIterator</a><type> & <a name="operator-eq"></a>QCacheIterator::operator= ( const <a href="qcacheiterator.html">QCacheIterator</a><type> & ci )
|
---|
179 | </h3>
|
---|
180 |
|
---|
181 | <p> Makes this an iterator for the same cache as <em>ci</em>. The new
|
---|
182 | iterator starts at the same item as ci.<a href="#current">current</a>(), but moves
|
---|
183 | independently 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
|
---|
189 | returns 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
|
---|
197 | returns 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>
|
---|
203 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
204 | Copyright © 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 © 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>
|
---|