QtCore/qiterator.h File Reference
#define Q_DECLARE_SEQUENTIAL_ITERATOR |
( |
|
C | ) |
|
Value:\
template <class T> \
class Q##C##Iterator \
{ \
typedef typename Q##C<T>::const_iterator const_iterator; \
const_iterator i; \
public: \
inline Q##C##Iterator(const Q##C<T> &container) \
:
c(container), i(c.constBegin()) {} \
inline Q##C##Iterator &operator=(const Q##C<T> &container) \
{ c = container; i = c.constBegin(); return *this; } \
inline void toFront() { i = c.constBegin(); } \
inline void toBack() { i = c.constEnd(); } \
inline bool hasNext() const { return i != c.constEnd(); } \
inline const T &next() { return *i++; } \
inline const T &peekNext() const { return *i; } \
inline bool hasPrevious() const { return i != c.constBegin(); } \
inline const T &previous() { return *--i; } \
inline
const T &peekPrevious()
const { const_iterator
p = i;
return *--
p; } \
inline
bool findNext(
const T &
t) \
{
while (i != c.constEnd())
if (*i++ ==
t)
return true;
return false; } \
inline
bool findPrevious(
const T &
t) \
{
while (i != c.constBegin())
if (*(--i) ==
t)
return true; \
return false; } \
};
Definition at line 83 of file qiterator.h.
#define Q_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR |
( |
|
C | ) |
|
#define Q_DECLARE_ASSOCIATIVE_ITERATOR |
( |
|
C | ) |
|
Value:\
template <class Key, class T> \
class Q##C##Iterator \
{ \
typedef typename Q##C<Key,T>::const_iterator const_iterator; \
typedef const_iterator Item; \
inline bool item_exists() const { return n != c.constEnd(); } \
public: \
inline Q##C##Iterator(const Q##C<Key,T> &container) \
:
c(container), i(c.constBegin()),
n(c.constEnd()) {} \
inline Q##C##Iterator &operator=(const Q##C<Key,T> &container) \
{ c = container; i = c.constBegin(); n = c.constEnd(); return *this; } \
inline void toFront() { i = c.constBegin(); n = c.constEnd(); } \
inline void toBack() { i = c.constEnd(); n = c.constEnd(); } \
inline bool hasNext() const { return i != c.constEnd(); } \
inline Item next() { n = i++;
return n; } \
inline Item peekNext() const { return i; } \
inline bool hasPrevious() const { return i != c.constBegin(); } \
inline Item previous() { n = --i;
return n; } \
inline Item peekPrevious()
const { const_iterator
p = i;
return --
p; } \
inline
const T &
value()
const { Q_ASSERT(item_exists());
return *
n; } \
inline
const Key &key()
const { Q_ASSERT(item_exists());
return n.key(); } \
inline
bool findNext(
const T &
t) \
{
while ((n = i) != c.constEnd())
if (*i++ ==
t)
return true;
return false; } \
inline
bool findPrevious(
const T &
t) \
{
while (i != c.constBegin())
if (*(n = --i) ==
t)
return true; \
n = c.constEnd(); return false; } \
};
GLsizei const GLfloat * value
Definition at line 151 of file qiterator.h.
#define Q_DECLARE_MUTABLE_ASSOCIATIVE_ITERATOR |
( |
|
C | ) |
|
Go to the source code of this file.