1QCacheIterator(3qt)                                        QCacheIterator(3qt)
2
3
4

NAME

6       QCacheIterator - Iterator for QCache collections
7

SYNOPSIS

9       #include <qcache.h>
10
11   Public Members
12       QCacheIterator ( const QCache<type> & cache )
13       QCacheIterator ( const QCacheIterator<type> & ci )
14       QCacheIterator<type> & operator= ( const QCacheIterator<type> & ci )
15       uint count () const
16       bool isEmpty () const
17       bool atFirst () const
18       bool atLast () const
19       type * toFirst ()
20       type * toLast ()
21       operator type * () const
22       type * current () const
23       QString currentKey () const
24       type * operator() ()
25       type * operator++ ()
26       type * operator+= ( uint jump )
27       type * operator-- ()
28       type * operator-= ( uint jump )
29

DESCRIPTION

31       The QCacheIterator class provides an iterator for QCache collections.
32
33       Note that the traversal order is arbitrary; you are not guaranteed any
34       particular order. If new objects are inserted into the cache while the
35       iterator is active, the iterator may or may not see them.
36
37       Multiple iterators are completely independent, even when they operate
38       on the same QCache. QCache updates all iterators that refer an item
39       when that item is removed.
40
41       QCacheIterator provides an operator++(), and an operator+=() to
42       traverse the cache. The current() and currentKey() functions are used
43       to access the current cache item and its key. The atFirst() and
44       atLast() return TRUE if the iterator points to the first or last item
45       in the cache respectively. The isEmpty() function returns TRUE if the
46       cache is empty, and count() returns the number of items in the cache.
47
48       Note that atFirst() and atLast() refer to the iterator's arbitrary
49       ordering, not to the cache's internal least recently used list.
50
51       See also QCache, Collection Classes, and Non-GUI Classes.
52

MEMBER FUNCTION DOCUMENTATION

QCacheIterator::QCacheIterator ( const QCache<type> & cache )

55       Constructs an iterator for cache. The current iterator item is set to
56       point to the first item in the cache.
57

QCacheIterator::QCacheIterator ( const QCacheIterator<type> & ci )

59       Constructs an iterator for the same cache as ci. The new iterator
60       starts at the same item as ci.current(), but moves independently from
61       there on.
62

bool QCacheIterator::atFirst () const

64       Returns TRUE if the iterator points to the first item in the cache;
65       otherwise returns FALSE. Note that this refers to the iterator's
66       arbitrary ordering, not to the cache's internal least recently used
67       list.
68
69       See also toFirst() and atLast().
70

bool QCacheIterator::atLast () const

72       Returns TRUE if the iterator points to the last item in the cache;
73       otherwise returns FALSE. Note that this refers to the iterator's
74       arbitrary ordering, not to the cache's internal least recently used
75       list.
76
77       See also toLast() and atFirst().
78

uint QCacheIterator::count () const

80       Returns the number of items in the cache on which this iterator
81       operates.
82
83       See also isEmpty().
84

type * QCacheIterator::current () const

86       Returns a pointer to the current iterator item.
87

QString QCacheIterator::currentKey () const

89       Returns the key for the current iterator item.
90

bool QCacheIterator::isEmpty () const

92       Returns TRUE if the cache is empty, i.e. count() == 0; otherwise it
93       returns FALSE.
94
95       See also count().
96

QCacheIterator::operator type * () const

98       Cast operator. Returns a pointer to the current iterator item. Same as
99       current().
100

type * QCacheIterator::operator() ()

102       Makes the succeeding item current and returns the original current
103       item.
104
105       If the current iterator item was the last item in the cache or if it
106       was 0, 0 is returned.
107

type * QCacheIterator::operator++ ()

109       Prefix++ makes the iterator point to the item just after current() and
110       makes that the new current item for the iterator. If current() was the
111       last item, operator++() returns 0.
112

type * QCacheIterator::operator+= ( uint jump )

114       Returns the item jump positions after the current item, or 0 if it is
115       beyond the last item. Makes this the current item.
116

type * QCacheIterator::operator-- ()

118       Prefix-- makes the iterator point to the item just before current() and
119       makes that the new current item for the iterator. If current() was the
120       first item, operator--() returns 0.
121

type * QCacheIterator::operator-= ( uint jump )

123       Returns the item jump positions before the current item, or 0 if it is
124       before the first item. Makes this the current item.
125

QCacheIterator<type> & QCacheIterator::operator= ( const QCacheIterator<type>

127       & ci )
128       Makes this an iterator for the same cache as ci. The new iterator
129       starts at the same item as ci.current(), but moves independently
130       thereafter.
131

type * QCacheIterator::toFirst ()

133       Sets the iterator to point to the first item in the cache and returns a
134       pointer to the item.
135
136       Sets the iterator to 0 and returns 0 if the cache is empty.
137
138       See also toLast() and isEmpty().
139

type * QCacheIterator::toLast ()

141       Sets the iterator to point to the last item in the cache and returns a
142       pointer to the item.
143
144       Sets the iterator to 0 and returns 0 if the cache is empty.
145
146       See also toFirst() and isEmpty().
147
148

SEE ALSO

150       http://doc.trolltech.com/qcacheiterator.html
151       http://www.trolltech.com/faq/tech.html
152
154       Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
155       license file included in the distribution for a complete license
156       statement.
157

AUTHOR

159       Generated automatically from the source code.
160

BUGS

162       If you find a bug in Qt, please report it as described in
163       http://doc.trolltech.com/bughowto.html.  Good bug reports help us to
164       help you. Thank you.
165
166       The definitive Qt documentation is provided in HTML format; it is
167       located at $QTDIR/doc/html and can be read using Qt Assistant or with a
168       web browser. This man page is provided as a convenience for those users
169       who prefer man pages, although this format is not officially supported
170       by Trolltech.
171
172       If you find errors in this manual page, please report them to qt-
173       bugs@trolltech.com.  Please include the name of the manual page
174       (qcacheiterator.3qt) and the Qt version (3.3.8).
175
176
177
178Trolltech AS                    2 February 2007            QCacheIterator(3qt)
Impressum