Qt 4.8
Public Functions | Protected Functions | Protected Variables | List of all members
QPatternist::AccelIterator Class Reference

Abstract base class for Iterators for the AccelTree, that contains common functions and members. More...

#include <qacceliterators_p.h>

Inheritance diagram for QPatternist::AccelIterator:
QAbstractXmlForwardIterator< T > QSharedData QPatternist::AncestorIterator< IncludeSelf > QPatternist::AttributeIterator QPatternist::ChildIterator QPatternist::DescendantIterator< IncludeSelf > QPatternist::FollowingIterator QPatternist::PrecedingIterator QPatternist::SiblingIterator< IsFollowing >

Public Functions

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 QAbstractXmlForwardIterator< T >::Ptr copy () const
 Copies this QAbstractXmlForwardIterator and returns the copy. More...
 
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...
 
virtual T next ()=0
 Returns the next item in the sequence, or a null object if the end has been reached. 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...
 

Protected Functions

 AccelIterator (const AccelTree *const doc, const AccelTree::PreNumber pre, const AccelTree::PreNumber currentPre)
 
QXmlNodeModelIndex closedExit ()
 

Protected Variables

QXmlNodeModelIndex m_current
 
AccelTree::PreNumber m_currentPre
 
const AccelTree *const m_document
 
xsInteger m_position
 
const AccelTree::PreNumber m_preNumber
 

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
 

Detailed Description

Abstract base class for Iterators for the AccelTree, that contains common functions and members.

Author
Frans Englichfrans.nosp@m..eng.nosp@m.lich@.nosp@m.noki.nosp@m.a.com

Definition at line 70 of file qacceliterators_p.h.

Constructors and Destructors

◆ AccelIterator()

QPatternist::AccelIterator::AccelIterator ( const AccelTree *const  doc,
const AccelTree::PreNumber  pre,
const AccelTree::PreNumber  currentPre 
)
inlineprotected

Definition at line 77 of file qacceliterators_p.h.

79  : m_document(doc)
80  , m_preNumber(pre)
81  , m_currentPre(currentPre)
82  , m_position(0)
83 
84  {
86  Q_ASSERT(m_preNumber >= 0);
87  }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
const AccelTree::PreNumber m_preNumber
AccelTree::PreNumber m_currentPre
const AccelTree *const m_document

Functions

◆ closedExit()

QXmlNodeModelIndex QPatternist::AccelIterator::closedExit ( )
inlineprotected

◆ current()

QXmlNodeModelIndex AccelIterator::current ( ) const
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 55 of file qacceliterators.cpp.

56 {
57  return m_current;
58 }
QXmlNodeModelIndex m_current

◆ position()

xsInteger AccelIterator::position ( ) const
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 50 of file qacceliterators.cpp.

51 {
52  return m_position;
53 }

Properties

◆ m_current

QXmlNodeModelIndex QPatternist::AccelIterator::m_current
protected

◆ m_currentPre

AccelTree::PreNumber QPatternist::AccelIterator::m_currentPre
protected

◆ m_document

const AccelTree* const QPatternist::AccelIterator::m_document
protected

◆ m_position

xsInteger QPatternist::AccelIterator::m_position
protected

◆ m_preNumber

const AccelTree::PreNumber QPatternist::AccelIterator::m_preNumber
protected

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