Qt 4.8
Public Functions | Private Functions | Static Private Functions | Friends | Related Functions | List of all members
QPatternist::ListIterator< T, ListType > Class Template Reference

Bridges values in Qt's QList container class into an QAbstractXmlForwardIterator. More...

#include <qabstractxmlforwarditerator_p.h>

Inheritance diagram for QPatternist::ListIterator< T, ListType >:
QPatternist::ListIteratorPlatform< T, T, ListIterator< T, ListType >, ListType > QAbstractXmlForwardIterator< T > QSharedData

Public Functions

 ListIterator (const ListType &list)
 
virtual QList< T > toList ()
 Performs a copy of this QAbstractXmlForwardIterator(with copy()), and returns its items in a QList. More...
 
virtual QVector< T > toVector ()
 
- Public Functions inherited from QPatternist::ListIteratorPlatform< T, T, ListIterator< T, ListType >, ListType >
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 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 qint64 position () const
 Returns the current position in the sequence represented by this. More...
 
- 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 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...
 

Private Functions

const T & inputToOutputItem (const T &inputType) const
 

Static Private Functions

static QList< T > toList (const QVector< T > &vector)
 
static QList< T > toList (const QList< T > &list)
 
static QVector< T > toVector (const QVector< T > &vector)
 
static QVector< T > toVector (const QList< T > &list)
 

Friends

class DeduplicateIterator
 
class IteratorVector
 
class ListIteratorPlatform< T, T, ListIterator< T, ListType >, ListType >
 

Related Functions

(Note that these are not member functions.)

 makeListIterator (const QList< T > &qList)
 An object generator for ListIterator. 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::ListIteratorPlatform< T, T, ListIterator< T, ListType >, ListType >
 ListIteratorPlatform (const ListType &list)
 Constructs a ListIteratorPlatform that walks the given list. More...
 
- Protected Variables inherited from QPatternist::ListIteratorPlatform< T, T, ListIterator< T, ListType >, ListType >
m_current
 
const ListType m_list
 
qint64 m_position
 

Detailed Description

template<typename T, typename ListType = QList<T>>
class QPatternist::ListIterator< T, ListType >

Bridges values in Qt's QList container class into an QAbstractXmlForwardIterator.

Note
This class or function is reentrant.
Since
4.4
Warning
This function is not part of the public interface.

ListIterator takes a reference to a QList<T> instance and allows access to that list via its QAbstractXmlForwardIterator interface. ListIterator is parameterized with the type to iterate over, e.g., Item or Expression::Ptr.

ListIterator is used by the ExpressionSequence to create an iterator over its operands. The iterator will be passed to a MappingIterator.

Definition at line 192 of file qabstractxmlforwarditerator_p.h.

Constructors and Destructors

◆ ListIterator()

template<typename T, typename ListType = QList<T>>
QPatternist::ListIterator< T, ListType >::ListIterator ( const ListType &  list)
inline

Definition at line 222 of file qabstractxmlforwarditerator_p.h.

222  : ListIteratorPlatform<T, T, ListIterator<T, ListType>, ListType>(list)
223  {
224  }

Functions

◆ inputToOutputItem()

template<typename T, typename ListType = QList<T>>
const T& QPatternist::ListIterator< T, ListType >::inputToOutputItem ( const T &  inputType) const
inlineprivate

Definition at line 237 of file qabstractxmlforwarditerator_p.h.

238  {
239  return inputType;
240  }

◆ toList() [1/3]

template<typename T, typename ListType = QList<T>>
static QList<T> QPatternist::ListIterator< T, ListType >::toList ( const QVector< T > &  vector)
inlinestaticprivate

Definition at line 211 of file qabstractxmlforwarditerator_p.h.

212  {
213  return vector.toList();
214  }
QList< T > toList() const
Returns a QList object with the data contained in this QVector.
Definition: qvector.h:770

◆ toList() [2/3]

template<typename T, typename ListType = QList<T>>
static QList<T> QPatternist::ListIterator< T, ListType >::toList ( const QList< T > &  list)
inlinestaticprivate

Definition at line 216 of file qabstractxmlforwarditerator_p.h.

217  {
218  return list;
219  }

◆ toList() [3/3]

template<typename T, typename ListType = QList<T>>
virtual QList<T> QPatternist::ListIterator< T, ListType >::toList ( )
inlinevirtual

Performs a copy of this QAbstractXmlForwardIterator(with copy()), and returns its items in a QList.

Warning
This function is not part of the public interface.

Thus, this function acts as a conversion function, converting the sequence to a QList.

This function may modify the iterator. It is not a getter, but potentially alters the iterator in the same way the next() function does. If this QAbstractXmlForwardIterator must not be modified, such that it can be used for evaluation with next(), use a copy().

Reimplemented from QAbstractXmlForwardIterator< T >.

Definition at line 226 of file qabstractxmlforwarditerator_p.h.

227  {
228  return toList(m_list);
229  }
virtual QList< T > toList()
Performs a copy of this QAbstractXmlForwardIterator(with copy()), and returns its items in a QList...

◆ toVector() [1/3]

template<typename T, typename ListType = QList<T>>
static QVector<T> QPatternist::ListIterator< T, ListType >::toVector ( const QVector< T > &  vector)
inlinestaticprivate

Definition at line 201 of file qabstractxmlforwarditerator_p.h.

202  {
203  return vector;
204  }

◆ toVector() [2/3]

template<typename T, typename ListType = QList<T>>
static QVector<T> QPatternist::ListIterator< T, ListType >::toVector ( const QList< T > &  list)
inlinestaticprivate

Definition at line 206 of file qabstractxmlforwarditerator_p.h.

207  {
208  return list.toVector();
209  }
QVector< T > toVector() const
Returns a QVector object with the data contained in this QList.
Definition: qvector.h:780

◆ toVector() [3/3]

template<typename T, typename ListType = QList<T>>
virtual QVector<T> QPatternist::ListIterator< T, ListType >::toVector ( )
inlinevirtual

Friends and Related Functions

◆ DeduplicateIterator

template<typename T, typename ListType = QList<T>>
friend class DeduplicateIterator
friend

Definition at line 244 of file qabstractxmlforwarditerator_p.h.

◆ IteratorVector

template<typename T, typename ListType = QList<T>>
friend class IteratorVector
friend

Definition at line 197 of file qabstractxmlforwarditerator_p.h.

◆ ListIteratorPlatform< T, T, ListIterator< T, ListType >, ListType >

template<typename T, typename ListType = QList<T>>
friend class ListIteratorPlatform< T, T, ListIterator< T, ListType >, ListType >
friend

Definition at line 241 of file qabstractxmlforwarditerator_p.h.

◆ makeListIterator()

template<typename T, typename ListType = QList<T>>
makeListIterator ( const QList< T > &  qList)
related

An object generator for ListIterator.

makeListIterator() is a convenience function to avoid specifying the full template instantiation for ListIterator. Conceptually, it is identical to Qt's qMakePair().

Definition at line 250 of file qabstractxmlforwarditerator_p.h.

251  {
252  return typename ListIterator<T>::Ptr(new ListIterator<T>(list));
253  }
QExplicitlySharedDataPointer< QAbstractXmlForwardIterator< T > > Ptr
A smart pointer wrapping an instance of a QAbstractXmlForwardIterator subclass.

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