![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
QTaggedIterator is a template class that wraps an iterator and exposes standard iterator traits. More...
#include <qiterable.h>
Public Types | |
| using | iterator_category = IteratorCategory |
Public Member Functions | |
| QTaggedIterator (Iterator &&it) | |
| Constructs a QTaggedIterator from an iterator or QConstIterator it. | |
| bool | operator== (const QTaggedIterator &o) const |
Returns true if other points to the same item as this iterator; otherwise returns false. | |
| bool | operator!= (const QTaggedIterator &o) const |
Returns true if other points to a different item than this iterator; otherwise returns false. | |
| QTaggedIterator & | operator++ () |
The prefix {++} operator ({++it}) advances the iterator to the next item in the container and returns an iterator to the new current item. | |
| QTaggedIterator | operator++ (int x) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.The postfix {++} operator ({it++}) advances the iterator to the next item in the container and returns an iterator to the previously current item. | |
| QTaggedIterator & | operator-- () |
The prefix {–} operator ({–it}) makes the preceding item current and returns an iterator to the new current item. | |
| QTaggedIterator | operator-- (int x) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.The postfix {–} operator ({it–}) makes the preceding item current and returns an iterator to the previously current item. | |
| QTaggedIterator & | operator+= (qsizetype j) |
| Advances the iterator by j items. | |
| QTaggedIterator & | operator-= (qsizetype j) |
| Makes the iterator go back by j items. | |
| QTaggedIterator | operator+ (qsizetype j) const |
| Returns an iterator to the item at j positions forward from this iterator. | |
| QTaggedIterator | operator- (qsizetype j) const |
| Returns an iterator to the item at j positions backward from this iterator. | |
| qsizetype | operator- (const QTaggedIterator &j) const |
| Returns the distance between this iterator and j. | |
| bool | operator< (const QTaggedIterator &j) |
| bool | operator>= (const QTaggedIterator &j) |
| bool | operator> (const QTaggedIterator &j) |
| bool | operator<= (const QTaggedIterator &j) |
Friends | |
| QTaggedIterator | operator+ (qsizetype j, const QTaggedIterator &k) |
| Returns an iterator to the item at j positions forward from iterator k. | |
QTaggedIterator is a template class that wraps an iterator and exposes standard iterator traits.
QTaggedIterator<Iterator, IteratorCategory> wraps an iterator, where Iterator is the underlying iterator type (such as QIterator or QConstIterator) and IteratorCategory is a standard iterator category tag (such as std::forward_iterator_tag or std::random_access_iterator_tag).
In order to use an iterator any of the standard algorithms, its iterator traits need to be known. As QMetaSequence::Iterable can work with many different kinds of containers, we cannot declare the traits in the iterator classes themselves. A QTaggedIterator gives you a way to explicitly declare a trait for a concrete instance of an iterator or QConstIterator.
Definition at line 74 of file qiterable.h.
| using QTaggedIterator< Iterator, IteratorCategory >::iterator_category = IteratorCategory |
Definition at line 77 of file qiterable.h.
|
inline |
Constructs a QTaggedIterator from an iterator or QConstIterator it.
Checks whether the IteratorCategory passed as template argument matches the run time capabilities of it; if there's no match, it is refused.
Definition at line 78 of file qiterable.h.
Referenced by QTaggedIterator< AssociativeIterator, void >::QTaggedIterator().
|
inline |
Returns true if other points to a different item than this iterator; otherwise returns false.
Definition at line 111 of file qiterable.h.
|
inline |
Returns an iterator to the item at j positions forward from this iterator.
Definition at line 118 of file qiterable.h.
|
inline |
The prefix {++} operator ({++it}) advances the iterator to the next item in the container and returns an iterator to the new current item.
Calling this function on QMetaSequence::Iterable::constEnd() leads to undefined results.
Definition at line 112 of file qiterable.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.The postfix {++} operator ({it++}) advances the iterator to the next item in the container and returns an iterator to the previously current item.
Definition at line 113 of file qiterable.h.
|
inline |
Advances the iterator by j items.
Definition at line 116 of file qiterable.h.
|
inline |
Returns the distance between this iterator and j.
Definition at line 120 of file qiterable.h.
|
inline |
Returns an iterator to the item at j positions backward from this iterator.
If the container in the QVariant does not support bi-directional iteration, calling this function leads to undefined results.
Definition at line 119 of file qiterable.h.
|
inline |
The prefix {–} operator ({–it}) makes the preceding item current and returns an iterator to the new current item.
Calling this function on QMetaSequence::Iterable::constBegin() leads to undefined results.
If the container in the QVariant does not support bi-directional iteration, calling this function leads to undefined results.
Definition at line 114 of file qiterable.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.The postfix {–} operator ({it–}) makes the preceding item current and returns an iterator to the previously current item.
If the container in the QVariant does not support bi-directional iteration, calling this function leads to undefined results.
Definition at line 115 of file qiterable.h.
|
inline |
Makes the iterator go back by j items.
If the container in the QVariant does not support bi-directional iteration, calling this function leads to undefined results.
Definition at line 117 of file qiterable.h.
|
inline |
Definition at line 122 of file qiterable.h.
Referenced by QTaggedIterator< AssociativeIterator, void >::operator>=().
|
inline |
Definition at line 125 of file qiterable.h.
|
inline |
Returns true if other points to the same item as this iterator; otherwise returns false.
Definition at line 110 of file qiterable.h.
|
inline |
Definition at line 124 of file qiterable.h.
Referenced by QTaggedIterator< AssociativeIterator, void >::operator<=().
|
inline |
Definition at line 123 of file qiterable.h.
|
friend |
Returns an iterator to the item at j positions forward from iterator k.
Definition at line 127 of file qiterable.h.