Qt 4.8
Public Types | Public Functions | Private Types | List of all members
QPatternist::IteratorVector Class Reference
Inheritance diagram for QPatternist::IteratorVector:
QPatternist::ListIterator< QXmlNodeModelIndexIteratorPointer, QVector< QXmlNodeModelIndexIteratorPointer > > QPatternist::ListIteratorPlatform< InputType, OutputType, Derived, ListType > QAbstractXmlForwardIterator< OutputType > QSharedData

Public Types

typedef QAbstractXmlForwardIterator< QXmlNodeModelIndexIteratorPointer >::Ptr Ptr
 
- Public Types inherited from QAbstractXmlForwardIterator< OutputType >
typedef QList< QExplicitlySharedDataPointer< QAbstractXmlForwardIterator< OutputType > > > List
 A QList containing QAbstractXmlForwardIterator::Ptr instances. More...
 
typedef QExplicitlySharedDataPointer< QAbstractXmlForwardIterator< OutputType > > Ptr
 A smart pointer wrapping an instance of a QAbstractXmlForwardIterator subclass. More...
 
typedef QVector< QExplicitlySharedDataPointer< QAbstractXmlForwardIterator< OutputType > > > Vector
 A QVector containing QAbstractXmlForwardIterator::Ptr instances. More...
 

Public Functions

virtual QAbstractXmlForwardIterator< QXmlNodeModelIndexIteratorPointer >::Ptr copy () const
 Copies this QAbstractXmlForwardIterator and returns the copy. More...
 
 IteratorVector (const ItVector &in)
 
- Public Functions inherited from QPatternist::ListIterator< QXmlNodeModelIndexIteratorPointer, QVector< QXmlNodeModelIndexIteratorPointer > >
 ListIterator (const QVector< QXmlNodeModelIndexIteratorPointer > &list)
 
virtual QList< QXmlNodeModelIndexIteratorPointertoList ()
 Performs a copy of this QAbstractXmlForwardIterator(with copy()), and returns its items in a QList. More...
 
virtual QVector< QXmlNodeModelIndexIteratorPointertoVector ()
 
- Public Functions inherited from QPatternist::ListIteratorPlatform< InputType, OutputType, Derived, ListType >
virtual qint64 count ()
 Determines the number of items this QAbstractXmlForwardIterator represents. More...
 
virtual OutputType current () const
 Returns the current item in the sequence. More...
 
virtual OutputType next ()
 Returns the next item in the sequence, or a null object if the end has been reached. More...
 
virtual qint64 position () const
 Returns the current position in the sequence represented by this. More...
 
- Public Functions inherited from QAbstractXmlForwardIterator< OutputType >
virtual bool isEmpty ()
 Returns true if the sequence is empty. More...
 
virtual OutputType 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 QAbstractXmlForwardIterator< OutputType >::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...
 

Private Types

typedef QVector< QXmlNodeModelIndexIteratorPointerItVector
 

Additional Inherited Members

- Public Variables inherited from QSharedData
QAtomicInt ref
 
- Protected Functions inherited from QPatternist::ListIteratorPlatform< InputType, OutputType, Derived, ListType >
 ListIteratorPlatform (const ListType &list)
 Constructs a ListIteratorPlatform that walks the given list. More...
 
- Protected Variables inherited from QPatternist::ListIteratorPlatform< InputType, OutputType, Derived, ListType >
OutputType m_current
 
const ListType m_list
 
qint64 m_position
 

Detailed Description

One might wonder, why not use makeVectorIterator() directly on a QVector with iterators?

A problem emerges QAbstractXmlForwardIterator::copy(). All "meta iterators" that contain other iterators and so forth, propagate the copy() call such that all involved iterators are copied. However, if we have a ListIterator of iterators it isn't aware of that it contains iterators. Hence, we have this class which is specialized(not in the template sense) on iterators, and hence copies them appropriately.

Definition at line 506 of file qabstractxmlnodemodel.cpp.

Typedefs

◆ ItVector

Definition at line 508 of file qabstractxmlnodemodel.cpp.

◆ Ptr

Definition at line 510 of file qabstractxmlnodemodel.cpp.

Constructors and Destructors

◆ IteratorVector()

QPatternist::IteratorVector::IteratorVector ( const ItVector in)
inline

Definition at line 512 of file qabstractxmlnodemodel.cpp.

513  {
514  }
Bridges values in Qt&#39;s QList container class into an QAbstractXmlForwardIterator. ...

Functions

◆ copy()

virtual QAbstractXmlForwardIterator<QXmlNodeModelIndexIteratorPointer>::Ptr QPatternist::IteratorVector::copy ( ) const
inlinevirtual

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 QPatternist::ListIteratorPlatform< InputType, OutputType, Derived, ListType >.

Definition at line 516 of file qabstractxmlnodemodel.cpp.

517  {
518  ItVector result;
519 
520  for(int i = 0; i < m_list.count(); ++i)
521  result.append(m_list.at(i)->copy());
522 
523  return Ptr(new IteratorVector(result));
524  }
QAbstractXmlForwardIterator< QXmlNodeModelIndexIteratorPointer >::Ptr Ptr
QVector< QXmlNodeModelIndexIteratorPointer > ItVector

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