Home · All Classes · Main Classes · Grouped Classes · Modules · Functions

QAbstractXmlForwardIterator Class Reference
[
QtXmlPatterns module]

The QAbstractXmlForwardIterator class is an abstract forward iterator. More...

 #include <QAbstractXmlForwardIterator>

Inherits QSharedData.

Inherited by QPatternist::EmptyIterator, QPatternist::ItemMappingIterator, QPatternist::QObjectPropertyToAttributeIterator, QPatternist::SequenceMappingIterator, and QPatternist::SingletonIterator.

Note: All the functions in this class are reentrant.

This class was introduced in Qt 4.4.

Public Types

Public Functions

Related Non-Members


Detailed Description

The QAbstractXmlForwardIterator class is an abstract forward iterator.

In order for an item to be able to be instantiated in QAbstractXmlForwardIterator, it needs to: - have a copy constructor, default constructor, and an assignment operator - An appropriate qIsForwardIteratorEnd() function

@ingroup Patternist_iterators @author Frans Englich <fenglich@trolltech.com>


Member Type Documentation

typedef QAbstractXmlForwardIterator::List

A QList instance, containing QAbstractXmlForwardIterator::Ptr instances.

typedef QAbstractXmlForwardIterator::Ptr

A smart pointer wrapping an instance of a QAbstractXmlForwardIterator subclass.

typedef QAbstractXmlForwardIterator::Vector

A QVector instance, containing QAbstractXmlForwardIterator::Ptr instances.


Member Function Documentation

QAbstractXmlForwardIterator::QAbstractXmlForwardIterator ()

Default constructor.

QAbstractXmlForwardIterator::~QAbstractXmlForwardIterator ()   [virtual]

Destructs this instance.

T QAbstractXmlForwardIterator::current () const   [pure virtual]

Returns the current item in the sequence. If it is called before any call to next(), a null object is returned. If the end of the sequence have been reached a null object is returned.

T QAbstractXmlForwardIterator::next ()   [pure virtual]

Returns the next item in the sequence, or a null object if the end has been reached.

qint64 QAbstractXmlForwardIterator::position () const   [pure virtual]

Returns the current position in the sequence that this QAbstractXmlForwardIterator represents.

The first position is 1, not 0. If next() hasn't been called, 0 is returned. If the end of this QAbstractXmlForwardIterator has been reached, -1 is returned.


Related Non-Members

bool qIsForwardIteratorEnd ( const T & unit )

Callback QAbstractXmlForwardIterator uses for determining whether unit is the end of a sequence.

If unit is a value that would signal the end of a sequence(typically a default constructed value), this function returns true, otherwise false.

This implementation works for all types that has a boolean operator. In other words, this function should work satisfactory for pointers, for example.


Copyright © 2007 Trolltech Trademarks
Qt 4.4.0-tp1