#include <QDjangoQuerySet.h>
Public Types | |
typedef std::bidirectional_iterator_tag | iterator_category |
Public Member Functions | |
const_iterator () | |
const_iterator (const const_iterator &other) | |
const T & | operator* () const |
const T * | operator-> () const |
bool | operator== (const const_iterator &other) const |
bool | operator!= (const const_iterator &other) const |
bool | operator< (const const_iterator &other) const |
bool | operator<= (const const_iterator &other) const |
bool | operator> (const const_iterator &other) const |
bool | operator>= (const const_iterator &other) const |
const_iterator & | operator++ () |
const_iterator | operator++ (int) |
const_iterator & | operator+= (int i) |
const_iterator | operator+ (int i) const |
const_iterator & | operator-= (int i) |
const_iterator | operator- (int i) const |
const_iterator & | operator-- () |
const_iterator | operator-- (int) |
difference_type | operator- (const const_iterator &other) const |
Friends | |
class | QDjangoQuerySet |
The QDjangoQuerySet::const_iterator class provides an STL-style const iterator for QDjangoQuerySet.
QDjangoQuerySet::const_iterator allows you to iterate over a QDjangoQuerySet. As a const iterator it doesn't permit you to modify the QDjangoQuerySet.
The default QDjangoQuerySet::const_iterator constructor creates an uninitialized iterator. You must initialize it using a QDjangoQuerySet function like QDjangoQuerySet::constBegin(), or QDjangoQuerySet::constEnd() before you can start iterating. Here's a typical loop that prints all the objects stored in a set:
QDjangoQuerySet<Weblog::Post> posts; foreach(const Weblog::Post &p, posts) { cout << p << endl; }
typedef std::bidirectional_iterator_tag QDjangoQuerySet< T >::const_iterator::iterator_category |
A synonym for std::bidirectional_iterator_tag indicating this iterator permits bidirectional access.
QDjangoQuerySet< T >::const_iterator::const_iterator | ( | ) | [inline] |
Constructs an uninitialized iterator.
Functions like operator*() and operator++() should not be called on an uninitialized iterator. Use const_iterator::operator=() to assign a value to it before using it.
QDjangoQuerySet< T >::const_iterator::const_iterator | ( | const const_iterator & | other | ) | [inline] |
Constructs a copy of other
.
bool QDjangoQuerySet< T >::const_iterator::operator!= | ( | const const_iterator & | other | ) | const [inline] |
Returns true
if other
points to a different item than this iterator; otherwise returns false
.
const T& QDjangoQuerySet< T >::const_iterator::operator* | ( | ) | const [inline] |
Returns the current item.
const_iterator QDjangoQuerySet< T >::const_iterator::operator+ | ( | int | i | ) | const [inline] |
Returns an iterator to the item at i
positions forward from this iterator. (If i
is negative, the iterator goes backward.)
const_iterator& QDjangoQuerySet< T >::const_iterator::operator++ | ( | ) | [inline] |
The prefix ++ operator (++it
) advances the iterator to the next item in the set and returns an iterator to the new current item.
Calling this function on QDjangoQuerySet::end() leads to undefined results.
const_iterator QDjangoQuerySet< T >::const_iterator::operator++ | ( | int | ) | [inline] |
The postfix ++ operator (it++
) advances the iterator to the next item in the set and returns an iterator to the previously current item.
Calling this function on QDjangoQuerySet::end() leads to undefined results.
const_iterator& QDjangoQuerySet< T >::const_iterator::operator+= | ( | int | i | ) | [inline] |
Advances the iterator by i
items. (If i
is negative, the iterator goes backward.)
const_iterator QDjangoQuerySet< T >::const_iterator::operator- | ( | int | i | ) | const [inline] |
Returns an iterator to the item at i
positions backward from this iterator. (If i
is negative, the iterator goes forward.)
difference_type QDjangoQuerySet< T >::const_iterator::operator- | ( | const const_iterator & | other | ) | const [inline] |
Returns the number of items between the item pointed to by other
and the item pointed to by this iterator.
const_iterator& QDjangoQuerySet< T >::const_iterator::operator-- | ( | ) | [inline] |
The prefix -- operator (--it
) makes the preceding item current and returns an iterator to the new current item.
Calling this function on QDjangoQuerySet::begin() leads to undefined results.
const_iterator QDjangoQuerySet< T >::const_iterator::operator-- | ( | int | ) | [inline] |
The postfix -- operator (it--
) makes the preceding item current and returns an iterator to the previously current item.
Calling this function on QDjangoQuerySet::begin() leads to undefined results.
const_iterator& QDjangoQuerySet< T >::const_iterator::operator-= | ( | int | i | ) | [inline] |
Makes the iterator go back by i
items. (If i
is negative, the iterator goes forward.)
const T* QDjangoQuerySet< T >::const_iterator::operator-> | ( | ) | const [inline] |
Returns a pointer to the current item.
bool QDjangoQuerySet< T >::const_iterator::operator< | ( | const const_iterator & | other | ) | const [inline] |
Returns true
if other points
to a position behind this iterator; otherwise returns false
.
bool QDjangoQuerySet< T >::const_iterator::operator<= | ( | const const_iterator & | other | ) | const [inline] |
Returns true
if other points
to a position behind or equal this iterator; otherwise returns false
.
bool QDjangoQuerySet< T >::const_iterator::operator== | ( | const const_iterator & | other | ) | const [inline] |
Returns true
if other
points to the same item as this iterator; otherwise returns false
.
bool QDjangoQuerySet< T >::const_iterator::operator> | ( | const const_iterator & | other | ) | const [inline] |
Returns true
if other points
to a position before this iterator; otherwise returns false
.
bool QDjangoQuerySet< T >::const_iterator::operator>= | ( | const const_iterator & | other | ) | const [inline] |
Returns true
if other points
to a position before or equal this iterator; otherwise returns false
.