const_iterator Class

class QFuture::const_iterator

Die Klasse QFuture::const_iterator bietet einen STL-ähnlichen Konst-Iterator für QFuture. Mehr...

Hinweis: Alle Funktionen in dieser Klasse sind reentrant.

Öffentliche Typen

Öffentliche Funktionen

const_iterator()
const_iterator(const QFuture<T>::const_iterator &other)
const T &operator*() const
QFuture<T>::const_iterator operator+(int j) const
QFuture<T>::const_iterator &operator++()
QFuture<T>::const_iterator operator++(int)
QFuture<T>::const_iterator &operator+=(int j)
QFuture<T>::const_iterator operator-(int j) const
QFuture<T>::const_iterator &operator--()
QFuture<T>::const_iterator operator--(int)
QFuture<T>::const_iterator &operator-=(int j)
const T *operator->() const
QFuture<T>::const_iterator &operator=(const QFuture<T>::const_iterator &other)
bool operator!=(const QFuture<T>::const_iterator &lhs, const QFuture<T>::const_iterator &rhs)
bool operator==(const QFuture<T>::const_iterator &lhs, const QFuture<T>::const_iterator &rhs)

Detaillierte Beschreibung

QFuture bietet sowohl Iteratoren im STL-Stil als auch Iteratoren im Java-Stil. Die Iteratoren im STL-Stil sind auf einer niedrigeren Ebene angesiedelt und umständlicher zu verwenden. Andererseits sind sie etwas schneller und haben für Entwickler, die die STL bereits kennen, den Vorteil der Vertrautheit.

Der Standardkonstruktor QFuture::const_iterator erzeugt einen nicht initialisierten Iterator. Sie müssen ihn mit einer QFuture -Funktion wie QFuture::constBegin() oder QFuture::constEnd() initialisieren, bevor Sie mit der Iteration beginnen. Hier ist eine typische Schleife, die alle in einem future verfügbaren Ergebnisse ausgibt:

QFuture<QString> future = ...;

QFuture<QString>::const_iterator i;
for (i = future.constBegin(); i != future.constEnd(); ++i)
    cout << qPrintable(*i) << endl;

Siehe auch QFutureIterator und QFuture.

Dokumentation der Mitgliedstypen

const_iterator::difference_type

Typendefinition für ptrdiff_t. Aus Gründen der STL-Kompatibilität bereitgestellt.

const_iterator::iterator_category

Typedef für std::bidirectional_iterator_tag. Für STL-Kompatibilität zur Verfügung gestellt.

const_iterator::pointer

Typendefinition für const T *. Aus Gründen der STL-Kompatibilität bereitgestellt.

const_iterator::reference

Typendefinition für const T &. Aus Gründen der STL-Kompatibilität bereitgestellt.

const_iterator::value_type

Typedef für T. Wird aus Gründen der STL-Kompatibilität bereitgestellt.

Dokumentation der Mitgliedsfunktionen

const_iterator::const_iterator()

Konstruiert einen uninitialisierten Iterator.

Funktionen wie operator*() und operator++() sollten nicht mit einem nicht initialisierten Iterartor aufgerufen werden. Verwenden Sie operator=(), um ihm einen Wert zuzuweisen, bevor Sie ihn verwenden.

Siehe auch QFuture::constBegin() und QFuture::constEnd().

const_iterator::const_iterator(const QFuture<T>::const_iterator &other)

Konstruiert eine Kopie von other.

const T &const_iterator::operator*() const

Gibt das aktuelle Ergebnis zurück.

QFuture<T>::const_iterator const_iterator::operator+(int j) const

Gibt einen Iterator zu den Ergebnissen an j Positionen vor diesem Iterator zurück. (Wenn j negativ ist, geht der Iterator rückwärts.)

Siehe auch operator-() und operator+=().

QFuture<T>::const_iterator &const_iterator::operator++()

Der Präfix-Operator ++ (++it) verschiebt den Iterator zum nächsten Ergebnis in der Zukunft und gibt einen Iterator zum neuen aktuellen Ergebnis zurück.

Der Aufruf dieser Funktion auf QFuture<T>::constEnd() führt zu undefinierten Ergebnissen.

Siehe auch operator--().

QFuture<T>::const_iterator const_iterator::operator++(int)

Dies ist eine überladene Funktion.

Der Postfix-Operator ++ (it++) setzt den Iterator auf das nächste Ergebnis in der Zukunft und gibt einen Iterator auf das zuvor aktuelle Ergebnis zurück.

QFuture<T>::const_iterator &const_iterator::operator+=(int j)

Bringt den Iterator um die Ergebnisse von j weiter. (Wenn j negativ ist, geht der Iterator rückwärts.)

Siehe auch operator-=() und operator+().

QFuture<T>::const_iterator const_iterator::operator-(int j) const

Gibt einen Iterator zum Ergebnis an j Positionen rückwärts von diesem Iterator zurück. (Wenn j negativ ist, geht der Iterator vorwärts.)

Siehe auch operator+() und operator-=().

QFuture<T>::const_iterator &const_iterator::operator--()

Der Präfix-Operator -- (--it) macht das vorhergehende Ergebnis aktuell und gibt einen Iterator zum neuen aktuellen Ergebnis zurück.

Der Aufruf dieser Funktion auf QFuture<T>::constBegin() führt zu undefinierten Ergebnissen.

Siehe auch operator++().

QFuture<T>::const_iterator const_iterator::operator--(int)

Dies ist eine überladene Funktion.

Der Postfix-Operator -- (it--) macht das vorhergehende Ergebnis aktuell und gibt einen Iterator zum vorher aktuellen Ergebnis zurück.

QFuture<T>::const_iterator &const_iterator::operator-=(int j)

Bringt den Iterator dazu, zurück zu gehen, indem er j ergibt. (Wenn j negativ ist, geht der Iterator vorwärts.)

Siehe auch operator+=() und operator-().

const T *const_iterator::operator->() const

Gibt einen Zeiger auf das aktuelle Ergebnis zurück.

QFuture<T>::const_iterator &const_iterator::operator=(const QFuture<T>::const_iterator &other)

Weist diesem Iterator other zu.

Verwandte Nicht-Mitglieder

[noexcept] bool operator!=(const QFuture<T>::const_iterator &lhs, const QFuture<T>::const_iterator &rhs)

Gibt true zurück, wenn lhs auf ein anderes Ergebnis als rhs iterator zeigt; andernfalls gibt false zurück.

Siehe auch operator==().

[noexcept] bool operator==(const QFuture<T>::const_iterator &lhs, const QFuture<T>::const_iterator &rhs)

Gibt true zurück, wenn lhs auf dasselbe Ergebnis wie der Iterator rhs zeigt; andernfalls wird false zurückgegeben.

Siehe auch operator!=().

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.