Qt 4.8
|
Helper class for ListIterator, and should only be instantiated through sub-classing. More...
#include <qabstractxmlforwarditerator_p.h>
Public Functions | |
virtual QAbstractXmlForwardIterator< OutputType >::Ptr | copy () const |
Copies this QAbstractXmlForwardIterator and returns the copy. More... | |
virtual qint64 | count () |
Determines the number of items this QAbstractXmlForwardIterator represents. More... | |
virtual OutputType | current () const |
Returns the current item in the sequence. More... | |
virtual OutputType | next () |
Returns the next item in the sequence, or a null object if the end has been reached. More... | |
virtual qint64 | position () const |
Returns the current position in the sequence represented by this. More... | |
Public Functions inherited from QAbstractXmlForwardIterator< OutputType > | |
virtual bool | isEmpty () |
Returns true if the sequence is empty. More... | |
virtual OutputType | last () |
Returns the item at the end of this QAbstractXmlForwardIterator. More... | |
QAbstractXmlForwardIterator () | |
Default constructor. More... | |
virtual qint64 | sizeHint () const |
Gives a hint to the size of the contained sequence. More... | |
virtual QList< OutputType > | toList () |
Performs a copy of this QAbstractXmlForwardIterator(with copy()), and returns its items in a QList. More... | |
virtual QAbstractXmlForwardIterator< OutputType >::Ptr | toReversed () |
Returns a reverse iterator for the sequence. More... | |
virtual | ~QAbstractXmlForwardIterator () |
Destructor. More... | |
Public Functions inherited from QSharedData | |
QSharedData () | |
Constructs a QSharedData object with a reference count of 0. More... | |
QSharedData (const QSharedData &) | |
Constructs a QSharedData object with reference count 0. More... | |
Protected Functions | |
ListIteratorPlatform (const ListType &list) | |
Constructs a ListIteratorPlatform that walks the given list. More... | |
Protected Variables | |
OutputType | m_current |
const ListType | m_list |
qint64 | m_position |
Friends | |
class | DeduplicateIterator |
Additional Inherited Members | |
Public Types inherited from QAbstractXmlForwardIterator< OutputType > | |
typedef QList< QExplicitlySharedDataPointer< QAbstractXmlForwardIterator< OutputType > > > | List |
A QList containing QAbstractXmlForwardIterator::Ptr instances. More... | |
typedef QExplicitlySharedDataPointer< QAbstractXmlForwardIterator< OutputType > > | Ptr |
A smart pointer wrapping an instance of a QAbstractXmlForwardIterator subclass. More... | |
typedef QVector< QExplicitlySharedDataPointer< QAbstractXmlForwardIterator< OutputType > > > | Vector |
A QVector containing QAbstractXmlForwardIterator::Ptr instances. More... | |
Public Variables inherited from QSharedData | |
QAtomicInt | ref |
Related Functions inherited from QAbstractXmlForwardIterator< OutputType > | |
static QAbstractXmlForwardIterator< TResult >::Ptr | makeSequenceMappingIterator (const TMapper &mapper, const QExplicitlySharedDataPointer< QAbstractXmlForwardIterator< TSource > > &source, const DynamicContext::Ptr &context) |
An object generator for SequenceMappingIterator. More... | |
bool | qIsForwardIteratorEnd (const OutputType &unit) |
The Callback QAbstractXmlForwardIterator uses for determining whether unit is the end of a sequence. More... | |
Helper class for ListIterator, and should only be instantiated through sub-classing.
ListIteratorPlatform iterates an InputList with instances of InputType. For every item in it, it returns an item from it, that is converted to OutputType by calling a function on Derived that has the following signature:
TODO Document why this class doesn't duplicate ItemMappingIterator.
Definition at line 134 of file qabstractxmlforwarditerator_p.h.
|
inlineprotected |
Constructs a ListIteratorPlatform that walks the given list.
Definition at line 180 of file qabstractxmlforwarditerator_p.h.
|
inlinevirtual |
Copies this QAbstractXmlForwardIterator and returns the copy.
A copy and the original instance are completely independent of each other. Because evaluating an QAbstractXmlForwardIterator modifies it, one should always use a copy when an QAbstractXmlForwardIterator needs to be used several times.
Reimplemented from QAbstractXmlForwardIterator< OutputType >.
Reimplemented in QPatternist::IteratorVector, and QPatternist::DeduplicateIterator.
Definition at line 174 of file qabstractxmlforwarditerator_p.h.
|
inlinevirtual |
Determines the number of items this QAbstractXmlForwardIterator represents.
Note that this function is not const
. It modifies the QAbstractXmlForwardIterator. The reason for this is efficiency. If this QAbstractXmlForwardIterator must not be changed, get a copy() before performing the count.
The default implementation simply calls next() until the end is reached. Hence, it may be of interest to override this function if the sub-class knows a better way of computing its count.
The number of items in the sequence is returned.
Reimplemented from QAbstractXmlForwardIterator< OutputType >.
Reimplemented in QPatternist::DeduplicateIterator.
Definition at line 169 of file qabstractxmlforwarditerator_p.h.
|
inlinevirtual |
Returns the current item in the sequence.
If this function is called before the first call to next(), a null object is returned. If the end of the sequence has been reached, a null object is returned.
Implements QAbstractXmlForwardIterator< OutputType >.
Definition at line 159 of file qabstractxmlforwarditerator_p.h.
|
inlinevirtual |
Returns the next item in the sequence, or a null object if the end has been reached.
Implements QAbstractXmlForwardIterator< OutputType >.
Reimplemented in QPatternist::DeduplicateIterator.
Definition at line 142 of file qabstractxmlforwarditerator_p.h.
|
inlinevirtual |
Returns the current position in the sequence represented by this.
The first position is 1, not 0. If next() hasn't been called, 0 is returned. If this has reached the end, -1 is returned.
Implements QAbstractXmlForwardIterator< OutputType >.
Definition at line 164 of file qabstractxmlforwarditerator_p.h.
|
friend |
Definition at line 139 of file qabstractxmlforwarditerator_p.h.
|
protected |
Definition at line 187 of file qabstractxmlforwarditerator_p.h.
Referenced by QPatternist::DeduplicateIterator::next().
|
protected |
Definition at line 185 of file qabstractxmlforwarditerator_p.h.
Referenced by QPatternist::DeduplicateIterator::copy(), and QPatternist::DeduplicateIterator::next().
|
protected |
Definition at line 186 of file qabstractxmlforwarditerator_p.h.
Referenced by QPatternist::DeduplicateIterator::next().