Qt 4.8
Public Functions | Friends | List of all members
QPatternist::EmptyIterator< T > Class Template Reference

An QAbstractXmlForwardIterator which always is empty. More...

#include <qitem_p.h>

Inheritance diagram for QPatternist::EmptyIterator< T >:
QAbstractXmlForwardIterator< T > QSharedData

Public Functions

virtual QAbstractXmlForwardIterator< T >::Ptr copy () const
 
virtual xsInteger count ()
 
virtual T current () const
 
virtual T next ()
 
virtual xsInteger position () const
 
virtual QAbstractXmlForwardIterator< T >::Ptr toReversed ()
 
- 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 QList< T > toList ()
 Performs a copy of this QAbstractXmlForwardIterator(with copy()), and returns its items in a QList. 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...
 

Friends

class CommonValues
 

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

template<typename T>
class QPatternist::EmptyIterator< T >

An QAbstractXmlForwardIterator which always is empty.

EmptyIterator is an QAbstractXmlForwardIterator over the type T, which always is empty. Other iterators can also be empty(or, at least behave as they are empty), but this class is special designed for this purpose and is therefore fast.

EmptyIterator's constructor is protected, instances is retrieved from CommonValues.

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

Definition at line 92 of file qitem_p.h.

Functions

◆ copy()

template<typename T>
virtual QAbstractXmlForwardIterator<T>::Ptr QPatternist::EmptyIterator< T >::copy ( ) const
inlinevirtual
Returns
this

Reimplemented from QAbstractXmlForwardIterator< T >.

Definition at line 123 of file qemptyiterator_p.h.

124  {
125  return typename QAbstractXmlForwardIterator<T>::Ptr(const_cast<EmptyIterator *>(this));
126  }
QExplicitlySharedDataPointer< QAbstractXmlForwardIterator< T > > Ptr
A smart pointer wrapping an instance of a QAbstractXmlForwardIterator subclass.

◆ count()

template<typename T>
virtual xsInteger QPatternist::EmptyIterator< T >::count ( )
inlinevirtual
Returns
always 0

Reimplemented from QAbstractXmlForwardIterator< T >.

Definition at line 115 of file qemptyiterator_p.h.

116  {
117  return 0;
118  }

◆ current()

template<typename T>
virtual T QPatternist::EmptyIterator< T >::current ( ) const
inlinevirtual
Returns
always a default constructed value, T().

Implements QAbstractXmlForwardIterator< T >.

Definition at line 91 of file qemptyiterator_p.h.

92  {
93  return T();
94  }

◆ next()

template<typename T>
virtual T QPatternist::EmptyIterator< T >::next ( )
inlinevirtual
Returns
always a default constructed value, T().

Implements QAbstractXmlForwardIterator< T >.

Definition at line 83 of file qemptyiterator_p.h.

84  {
85  return T();
86  }

◆ position()

template<typename T>
virtual xsInteger QPatternist::EmptyIterator< T >::position ( ) const
inlinevirtual
Returns
always 0.

Implements QAbstractXmlForwardIterator< T >.

Definition at line 99 of file qemptyiterator_p.h.

100  {
101  return 0;
102  }

◆ toReversed()

template<typename T>
virtual QAbstractXmlForwardIterator<T>::Ptr QPatternist::EmptyIterator< T >::toReversed ( )
inlinevirtual
Returns
always this, the reverse of () is ().

Reimplemented from QAbstractXmlForwardIterator< T >.

Definition at line 107 of file qemptyiterator_p.h.

108  {
109  return typename QAbstractXmlForwardIterator<T>::Ptr(const_cast<EmptyIterator<T> *>(this));
110  }
QExplicitlySharedDataPointer< QAbstractXmlForwardIterator< T > > Ptr
A smart pointer wrapping an instance of a QAbstractXmlForwardIterator subclass.

Friends and Related Functions

◆ CommonValues

template<typename T>
friend class CommonValues
friend

Definition at line 129 of file qemptyiterator_p.h.


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