Qt 4.8
|
An QAbstractXmlForwardIterator over exactly one item. More...
#include <qsingletoniterator_p.h>
Public Functions | |
virtual QAbstractXmlForwardIterator< T >::Ptr | copy () const |
Copies this QAbstractXmlForwardIterator and returns the copy. More... | |
virtual xsInteger | count () |
virtual T | current () const |
Returns the current item in the sequence. More... | |
virtual T | 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... | |
SingletonIterator (const T &item) | |
virtual QAbstractXmlForwardIterator< T >::Ptr | toReversed () |
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 () |
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 | |
const T | m_item |
qint8 | m_position |
Related Functions | |
(Note that these are not member functions.) | |
template<typename T > | |
SingletonIterator< T >::Ptr | makeSingletonIterator (const T &item) |
An object generator for SingletonIterator. More... | |
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... | |
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 |
An QAbstractXmlForwardIterator over exactly one item.
SingletonIterator's constructor takes one value which is the item it forms an QAbstractXmlForwardIterator over. Other QAbstractXmlForwardIterator instances can also form an QAbstractXmlForwardIterator with one in length, but by that SingletonIterator has this as it only task, it means it is efficient at it.
Having to represent single items in Iterators is relatively common.
Definition at line 79 of file qsingletoniterator_p.h.
|
inline |
Creates an iterator over item
.
null
. Use the EmptyIterator for the empty sequence Definition at line 88 of file qsingletoniterator_p.h.
Referenced by QPatternist::SingletonIterator< T >::copy().
|
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< T >.
Definition at line 145 of file qsingletoniterator_p.h.
|
inlinevirtual |
Reimplemented from QAbstractXmlForwardIterator< T >.
Definition at line 140 of file qsingletoniterator_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< T >.
Definition at line 116 of file qsingletoniterator_p.h.
|
inlinevirtual |
Returns the next item in the sequence, or a null object if the end has been reached.
Implements QAbstractXmlForwardIterator< T >.
Definition at line 94 of file qsingletoniterator_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< T >.
Definition at line 124 of file qsingletoniterator_p.h.
|
inlinevirtual |
Reimplemented from QAbstractXmlForwardIterator< T >.
Definition at line 132 of file qsingletoniterator_p.h.
|
related |
An object generator for SingletonIterator.
makeSingletonIterator() is a convenience function for avoiding specifying the full template instantiation for SingletonIterator. Conceptually, it is identical to Qt's qMakePair().
Definition at line 167 of file qsingletoniterator_p.h.
|
private |
Definition at line 151 of file qsingletoniterator_p.h.
Referenced by QPatternist::SingletonIterator< T >::copy(), QPatternist::SingletonIterator< T >::current(), QPatternist::SingletonIterator< T >::next(), and QPatternist::SingletonIterator< T >::toReversed().
|
private |
Definition at line 152 of file qsingletoniterator_p.h.
Referenced by QPatternist::SingletonIterator< T >::current(), QPatternist::SingletonIterator< T >::next(), and QPatternist::SingletonIterator< T >::position().