Qt 4.8
Public Functions | List of all members
QPatternist::FollowingIterator Class Reference

Implements axis following for the AccelTree. More...

#include <qacceliterators_p.h>

Inheritance diagram for QPatternist::FollowingIterator:
QPatternist::AccelIterator QAbstractXmlForwardIterator< T > QSharedData

Public Functions

virtual QXmlNodeModelIndex::Iterator::Ptr copy () const
 Copies this QAbstractXmlForwardIterator and returns the copy. More...
 
 FollowingIterator (const AccelTree *const doc, const AccelTree::PreNumber pre)
 
virtual QXmlNodeModelIndex next ()
 Returns the next item in the sequence, or a null object if the end has been reached. More...
 
- Public Functions inherited from QPatternist::AccelIterator
virtual QXmlNodeModelIndex current () const
 Returns the current item in the sequence. More...
 
virtual xsInteger position () const
 Returns the current position in the sequence represented by this. More...
 
- Public Functions inherited from QAbstractXmlForwardIterator< T >
virtual qint64 count ()
 Determines the number of items this QAbstractXmlForwardIterator represents. More...
 
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...
 

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
 
- Protected Functions inherited from QPatternist::AccelIterator
 AccelIterator (const AccelTree *const doc, const AccelTree::PreNumber pre, const AccelTree::PreNumber currentPre)
 
QXmlNodeModelIndex closedExit ()
 
- Protected Variables inherited from QPatternist::AccelIterator
QXmlNodeModelIndex m_current
 
AccelTree::PreNumber m_currentPre
 
const AccelTree *const m_document
 
xsInteger m_position
 
const AccelTree::PreNumber m_preNumber
 

Detailed Description

Implements axis following for the AccelTree.

Author
Frans Englich frans.nosp@m..eng.nosp@m.lich@.nosp@m.noki.nosp@m.a.com

Definition at line 347 of file qacceliterators_p.h.

Constructors and Destructors

◆ FollowingIterator()

QPatternist::FollowingIterator::FollowingIterator ( const AccelTree *const  doc,
const AccelTree::PreNumber  pre 
)
inline

@ pre must have at least one child.

Definition at line 353 of file qacceliterators_p.h.

354  : AccelIterator(doc, pre, pre)
355  {
356  }
AccelIterator(const AccelTree *const doc, const AccelTree::PreNumber pre, const AccelTree::PreNumber currentPre)

Functions

◆ copy()

QXmlNodeModelIndex::Iterator::Ptr FollowingIterator::copy ( ) const
virtual

Copies this QAbstractXmlForwardIterator and returns the copy.

Warning
This function is not part of the public interface.

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 127 of file qacceliterators.cpp.

128 {
130 }
QExplicitlySharedDataPointer< QAbstractXmlForwardIterator< T > > Ptr
A smart pointer wrapping an instance of a QAbstractXmlForwardIterator subclass.
FollowingIterator(const AccelTree *const doc, const AccelTree::PreNumber pre)
const AccelTree::PreNumber m_preNumber
const AccelTree *const m_document

◆ next()

QXmlNodeModelIndex FollowingIterator::next ( )
virtual

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

Implements QAbstractXmlForwardIterator< T >.

Definition at line 60 of file qacceliterators.cpp.

61 {
62  /* "the following axis contains all nodes that are descendants
63  * of the root of the tree in which the context node is found,
64  * are not descendants of the context node, and occur after
65  * the context node in document order." */
66 
67  if(m_position == 0)
68  {
69  /* Skip the descendants. */
71  }
72 
74  return closedExit();
75 
77  {
78  ++m_currentPre;
80  return closedExit();
81  }
82 
84  ++m_position;
85  ++m_currentPre;
86  return m_current;
87 }
QXmlNodeModelIndex m_current
virtual QXmlNodeModelIndex::NodeKind kind(const QXmlNodeModelIndex &ni) const
Returns a value indicating the kind of node identified by ni.
Definition: qacceltree.cpp:214
const AccelTree::PreNumber m_preNumber
QXmlNodeModelIndex createIndex(qint64 data) const
Creates a node index with data as its internal data.
AccelTree::PreNumber m_currentPre
PreNumber maximumPreNumber() const
Definition: qacceltree_p.h:333
PreNumber size(const PreNumber pre) const
Definition: qacceltree_p.h:343
QXmlNodeModelIndex closedExit()
const AccelTree *const m_document

The documentation for this class was generated from the following files: