Qt 4.8
Public Functions | Private Types | Private Functions | Properties | List of all members
QMutableSetIterator< T > Class Template Reference

#include <qset.h>

Public Functions

bool findNext (const T &t)
 
bool findPrevious (const T &t)
 
bool hasNext () const
 
bool hasPrevious () const
 
const T & next ()
 
QMutableSetIteratoroperator= (QSet< T > &container)
 
const T & peekNext () const
 
const T & peekPrevious () const
 
const T & previous ()
 
 QMutableSetIterator (QSet< T > &container)
 
void remove ()
 
void toBack ()
 
void toFront ()
 
const T & value () const
 
 ~QMutableSetIterator ()
 

Private Types

typedef QSet< T >::iterator iterator
 

Private Functions

bool item_exists () const
 

Properties

QSet< T > * c
 
iterator i
 
iterator n
 

Detailed Description

template<typename T>
class QMutableSetIterator< T >

Definition at line 333 of file qset.h.

Typedefs

◆ iterator

template<typename T >
typedef QSet<T>::iterator QMutableSetIterator< T >::iterator
private

Definition at line 335 of file qset.h.

Constructors and Destructors

◆ QMutableSetIterator()

template<typename T >
QMutableSetIterator< T >::QMutableSetIterator ( QSet< T > &  container)
inline

Definition at line 341 of file qset.h.

342  : c(&container)
343  { c->setSharable(false); i = c->begin(); n = c->end(); }
iterator n
Definition: qset.h:337
QSet< T > * c
Definition: qset.h:336
iterator i
Definition: qset.h:337

◆ ~QMutableSetIterator()

template<typename T >
QMutableSetIterator< T >::~QMutableSetIterator ( )
inline

Definition at line 344 of file qset.h.

345  { c->setSharable(true); }
QSet< T > * c
Definition: qset.h:336

Functions

◆ findNext()

template<typename T >
bool QMutableSetIterator< T >::findNext ( const T &  t)
inline

Definition at line 360 of file qset.h.

361  { while (c->constEnd() != (n = i)) if (*i++ == t) return true; return false; }
iterator n
Definition: qset.h:337
QSet< T > * c
Definition: qset.h:336
iterator i
Definition: qset.h:337

◆ findPrevious()

template<typename T >
bool QMutableSetIterator< T >::findPrevious ( const T &  t)
inline

Definition at line 362 of file qset.h.

363  { while (c->constBegin() != i) if (*(n = --i) == t) return true;
364  n = c->end(); return false; }
iterator n
Definition: qset.h:337
QSet< T > * c
Definition: qset.h:336
iterator i
Definition: qset.h:337

◆ hasNext()

template<typename T >
bool QMutableSetIterator< T >::hasNext ( ) const
inline

Definition at line 351 of file qset.h.

351 { return c->constEnd() != i; }
QSet< T > * c
Definition: qset.h:336
iterator i
Definition: qset.h:337

◆ hasPrevious()

template<typename T >
bool QMutableSetIterator< T >::hasPrevious ( ) const
inline

Definition at line 354 of file qset.h.

354 { return c->constBegin() != i; }
QSet< T > * c
Definition: qset.h:336
iterator i
Definition: qset.h:337

◆ item_exists()

template<typename T >
bool QMutableSetIterator< T >::item_exists ( ) const
inlineprivate

Definition at line 338 of file qset.h.

338 { return c->constEnd() != n; }
iterator n
Definition: qset.h:337
QSet< T > * c
Definition: qset.h:336

◆ next()

template<typename T >
const T& QMutableSetIterator< T >::next ( )
inline

Definition at line 352 of file qset.h.

352 { n = i++; return *n; }
iterator n
Definition: qset.h:337
iterator i
Definition: qset.h:337

◆ operator=()

template<typename T >
QMutableSetIterator& QMutableSetIterator< T >::operator= ( QSet< T > &  container)
inline

Definition at line 346 of file qset.h.

347  { c->setSharable(true); c = &container; c->setSharable(false);
348  i = c->begin(); n = c->end(); return *this; }
iterator n
Definition: qset.h:337
QSet< T > * c
Definition: qset.h:336
iterator i
Definition: qset.h:337

◆ peekNext()

template<typename T >
const T& QMutableSetIterator< T >::peekNext ( ) const
inline

Definition at line 353 of file qset.h.

353 { return *i; }
iterator i
Definition: qset.h:337

◆ peekPrevious()

template<typename T >
const T& QMutableSetIterator< T >::peekPrevious ( ) const
inline

Definition at line 356 of file qset.h.

356 { iterator p = i; return *--p; }
QSet< T >::iterator iterator
Definition: qset.h:335
iterator i
Definition: qset.h:337

◆ previous()

template<typename T >
const T& QMutableSetIterator< T >::previous ( )
inline

Definition at line 355 of file qset.h.

355 { n = --i; return *n; }
iterator n
Definition: qset.h:337
iterator i
Definition: qset.h:337

◆ remove()

template<typename T >
void QMutableSetIterator< T >::remove ( )
inline

Definition at line 357 of file qset.h.

358  { if (c->constEnd() != n) { i = c->erase(n); n = c->end(); } }
iterator n
Definition: qset.h:337
QSet< T > * c
Definition: qset.h:336
iterator i
Definition: qset.h:337

◆ toBack()

template<typename T >
void QMutableSetIterator< T >::toBack ( )
inline

Definition at line 350 of file qset.h.

350 { i = c->end(); n = i; }
iterator n
Definition: qset.h:337
QSet< T > * c
Definition: qset.h:336
iterator i
Definition: qset.h:337

◆ toFront()

template<typename T >
void QMutableSetIterator< T >::toFront ( )
inline

Definition at line 349 of file qset.h.

349 { i = c->begin(); n = c->end(); }
iterator n
Definition: qset.h:337
QSet< T > * c
Definition: qset.h:336
iterator i
Definition: qset.h:337

◆ value()

template<typename T >
const T& QMutableSetIterator< T >::value ( ) const
inline

Definition at line 359 of file qset.h.

359 { Q_ASSERT(item_exists()); return *n; }
iterator n
Definition: qset.h:337
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
bool item_exists() const
Definition: qset.h:338

Properties

◆ c

template<typename T >
QSet<T>* QMutableSetIterator< T >::c
private

Definition at line 336 of file qset.h.

◆ i

template<typename T >
iterator QMutableSetIterator< T >::i
private

Definition at line 337 of file qset.h.

◆ n

template<typename T >
iterator QMutableSetIterator< T >::n
private

Definition at line 337 of file qset.h.


The documentation for this class was generated from the following file: