![]() |
Qt 4.8
|
Forms an QAbstractXmlForwardIterator over a sequence of integers, which each is the position of where a search parameter appeared in another QAbstractXmlForwardIterator. More...
#include <qindexofiterator_p.h>
Public Functions | |
| virtual const SourceLocationReflection * | actualReflection () const |
| virtual Item::Iterator::Ptr | copy () const |
| Copies this QAbstractXmlForwardIterator and returns the copy. More... | |
| virtual Item | current () const |
| Returns the current item in the sequence. More... | |
| IndexOfIterator (const Item::Iterator::Ptr &inputSequence, const Item &searchParam, const AtomicComparator::Ptr &comp, const DynamicContext::Ptr &context, const Expression::ConstPtr &expr) | |
| virtual Item | next () |
| Returns the next item in the sequence, or a null object if the end has been reached. More... | |
| AtomicComparator::Operator | operatorID () const |
| 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... | |
Public Functions inherited from QPatternist::SourceLocationReflection | |
| virtual QString | description () const |
| virtual QSourceLocation | sourceLocation () const |
| SourceLocationReflection () | |
| virtual | ~SourceLocationReflection () |
Properties | |
| const DynamicContext::Ptr | m_context |
| Item | m_current |
| const Expression::ConstPtr | m_expr |
| xsInteger | m_position |
| const Item | m_searchParam |
| const Item::Iterator::Ptr | m_seq |
| xsInteger | m_seqPos |
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::ComparisonPlatform< IndexOfIterator, false > | |
| const AtomicComparator::Ptr & | comparator () const |
| bool | compare (const Item &i1, const Item &i2, const AtomicComparator::Ptr &comp, const AtomicComparator::Operator op) const |
Compares i1 and i2 with operator op, using comparator comp. All input arguments must be valid, and not null. More... | |
| ComparisonPlatform () | |
| AtomicComparator::ComparisonResult | detailedFlexibleCompare (const Item &it1, const Item &it2, const DynamicContext::Ptr &context) const |
like flexibleCompare(), but returns the result as an AtomicComparator::Operator instead of bool. More... | |
| AtomicComparator::Ptr | fetchComparator (const ItemType::Ptr &type1, const ItemType::Ptr &type2, const ReportContext::Ptr &context) const |
| bool | flexibleCompare (const Item &it1, const Item &it2, const DynamicContext::Ptr &context) const |
Compares it1 against it2, using comparator() and operatorID(). More... | |
| void | prepareComparison (const AtomicComparator::Ptr &comparator) |
| void | useCaseInsensitiveComparator () |
Related Functions inherited from QAbstractXmlForwardIterator< T > | |
| template<typename TResult , typename TSource , typename TMapper > | |
| static QAbstractXmlForwardIterator< TResult >::Ptr | makeSequenceMappingIterator (const TMapper &mapper, const QExplicitlySharedDataPointer< QAbstractXmlForwardIterator< TSource > > &source, const DynamicContext::Ptr &context) |
| An object generator for SequenceMappingIterator. More... | |
| bool | qIsForwardIteratorEnd (const T &unit) |
| The Callback QAbstractXmlForwardIterator uses for determining whether unit is the end of a sequence. More... | |
Forms an QAbstractXmlForwardIterator over a sequence of integers, which each is the position of where a search parameter appeared in another QAbstractXmlForwardIterator.
Definition at line 76 of file qindexofiterator_p.h.
| IndexOfIterator::IndexOfIterator | ( | const Item::Iterator::Ptr & | inputSequence, |
| const Item & | searchParam, | ||
| const AtomicComparator::Ptr & | comp, | ||
| const DynamicContext::Ptr & | context, | ||
| const Expression::ConstPtr & | expr | ||
| ) |
Creates an IndexOfIterator, whose next() function returns integers being the index positions of where searchParam was found in inputSequence.
| comp | the AtomicComparator to be used for comparing values. This may be null, meaning the IndexOfIterator iterator will dynamically determine what comparator to use on an item per item basis, which is slower. |
| searchParam | the item which should be compared to the items in inputSequence. |
| inputSequence | the input sequence which indexes of the searchParam should be returned for. |
| context | the usual DynamicContext |
| expr | the Expression that this IndexOfIterator is evaluating for. It is used for error reporting, via actualReflection(). |
Definition at line 50 of file qindexofiterator.cpp.
Referenced by copy().
|
virtual |
Implements QPatternist::SourceLocationReflection.
Definition at line 110 of file qindexofiterator.cpp.
Referenced by operatorID().
|
virtual |
Copies this QAbstractXmlForwardIterator and returns the copy.
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 101 of file qindexofiterator.cpp.
|
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 91 of file qindexofiterator.cpp.
|
virtual |
Returns the next item in the sequence, or a null object if the end has been reached.
Implements QAbstractXmlForwardIterator< T >.
Definition at line 67 of file qindexofiterator.cpp.
|
inline |
Definition at line 107 of file qindexofiterator_p.h.
|
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 96 of file qindexofiterator.cpp.
|
private |
Definition at line 117 of file qindexofiterator_p.h.
|
private |
Definition at line 119 of file qindexofiterator_p.h.
|
private |
Definition at line 118 of file qindexofiterator_p.h.
Referenced by actualReflection(), and copy().
|
private |
Definition at line 120 of file qindexofiterator_p.h.
Referenced by next(), and position().
|
private |
Definition at line 116 of file qindexofiterator_p.h.
|
private |
Definition at line 115 of file qindexofiterator_p.h.
|
private |
Definition at line 121 of file qindexofiterator_p.h.
Referenced by next().