Qt 4.8
|
Conceptually inserts one QAbstractXmlForwardIterator into another, make two QAbstractXmlForwardIterator instances appear as one. More...
#include <qinsertioniterator_p.h>
Public Functions | |
virtual Item::Iterator::Ptr | copy () const |
Copies this QAbstractXmlForwardIterator and returns the copy. More... | |
virtual xsInteger | count () |
Determines the number of items this QAbstractXmlForwardIterator represents. More... | |
virtual Item | current () const |
Returns the current item in the sequence. More... | |
InsertionIterator (const Item::Iterator::Ptr &target, const xsInteger position, const Item::Iterator::Ptr &insertIterator) | |
virtual Item | next () |
Returns the next item in the sequence, or a null object if the end has been reached. More... | |
virtual xsInteger | position () const |
Returns the current position in the sequence represented by this. More... | |
Public Functions inherited from QAbstractXmlForwardIterator< T > | |
virtual bool | isEmpty () |
Returns true if the sequence is empty. More... | |
virtual T | 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< T > | toList () |
Performs a copy of this QAbstractXmlForwardIterator(with copy()), and returns its items in a QList. More... | |
virtual QAbstractXmlForwardIterator< T >::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... | |
Properties | |
Item | m_current |
const xsInteger | m_insertPos |
const Item::Iterator::Ptr | m_inserts |
bool | m_isInserting |
xsInteger | m_position |
const Item::Iterator::Ptr | m_target |
Additional Inherited Members | |
Public Types inherited from QAbstractXmlForwardIterator< T > | |
typedef QList< QExplicitlySharedDataPointer< QAbstractXmlForwardIterator< T > > > | List |
A QList containing QAbstractXmlForwardIterator::Ptr instances. More... | |
typedef QExplicitlySharedDataPointer< QAbstractXmlForwardIterator< T > > | Ptr |
A smart pointer wrapping an instance of a QAbstractXmlForwardIterator subclass. More... | |
typedef QVector< QExplicitlySharedDataPointer< QAbstractXmlForwardIterator< T > > > | Vector |
A QVector containing QAbstractXmlForwardIterator::Ptr instances. More... | |
Public Variables inherited from QSharedData | |
QAtomicInt | ref |
Related Functions inherited from QAbstractXmlForwardIterator< T > | |
template<typename TResult , typename TSource , typename TMapper > | |
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 T &unit) |
The Callback QAbstractXmlForwardIterator uses for determining whether unit is the end of a sequence. More... | |
Conceptually inserts one QAbstractXmlForwardIterator into another, make two QAbstractXmlForwardIterator instances appear as one.
An InsertionIterator represents a sequence that is the merge of two sequences, where one of the iterators is conceptually inserted at a given position. This is done while retaining the characteristic of being pull-based.
InsertionIterator contains the logic for the implementation of the fn:insert-before()
function, whose definition therefore specifies the detailed behaviors of the InsertionIterator.
Definition at line 81 of file qinsertioniterator_p.h.
InsertionIterator::InsertionIterator | ( | const Item::Iterator::Ptr & | target, |
const xsInteger | position, | ||
const Item::Iterator::Ptr & | insertIterator | ||
) |
Creates an InsertionIterator whose result is a merge of the iterator insertIterator
into the iterator target
at position position
.
target | the iterator containing the items that the item in insertIterator will be inserted into. |
position | the insertion position. Must be 1 or larger |
insertIterator | the iterator containing the items to insert at position position |
Definition at line 49 of file qinsertioniterator.cpp.
Referenced by copy().
|
virtual |
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< T >.
Definition at line 123 of file qinsertioniterator.cpp.
|
virtual |
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< T >.
Definition at line 108 of file qinsertioniterator.cpp.
|
virtual |
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< T >.
Definition at line 113 of file qinsertioniterator.cpp.
|
virtual |
Returns the next item in the sequence, or a null object if the end has been reached.
Implements QAbstractXmlForwardIterator< T >.
Definition at line 63 of file qinsertioniterator.cpp.
|
virtual |
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< T >.
Definition at line 118 of file qinsertioniterator.cpp.
|
private |
Definition at line 110 of file qinsertioniterator_p.h.
|
private |
Definition at line 108 of file qinsertioniterator_p.h.
Referenced by copy(), InsertionIterator(), and next().
|
private |
Definition at line 109 of file qinsertioniterator_p.h.
|
private |
Definition at line 112 of file qinsertioniterator_p.h.
Referenced by next().
|
private |
Definition at line 111 of file qinsertioniterator_p.h.
Referenced by next(), and position().
|
private |
Definition at line 107 of file qinsertioniterator_p.h.