![]() |
Qt 4.8
|
Filters another sequence by removing duplicates such that the items are unique. More...
#include <qdistinctiterator_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... | |
| DistinctIterator (const Item::Iterator::Ptr &seq, const AtomicComparator::Ptr &comp, const Expression::ConstPtr &expression, const DynamicContext::Ptr &context) | |
| 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 |
| Item::List | m_processed |
| const Item::Iterator::Ptr | m_seq |
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< DistinctIterator, 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... | |
Filters another sequence by removing duplicates such that the items are unique.
DistinctIterator takes an input sequence, and returns a sequence where each item is unique. Thus, DistinctIterator removes the duplicates of items in a sequence. DistinctIterator is central in the implementation of the fn:distinct-values() function.
Definition at line 83 of file qdistinctiterator_p.h.
| DistinctIterator::DistinctIterator | ( | const Item::Iterator::Ptr & | seq, |
| const AtomicComparator::Ptr & | comp, | ||
| const Expression::ConstPtr & | expression, | ||
| const DynamicContext::Ptr & | context | ||
| ) |
Creates a DistinctIterator.
| comp | the AtomicComparator to be used for comparing values. This may be null, meaning the IndexOfIterator iterator will dynamically determine what comparator to use |
| seq | the sequence whose duplicates should be filtered out |
| context | the usual context, used for error reporting and by AtomicComparators. |
| expression | the Expression that this DistinctIterator is evaluating for. It is used for error reporting, via actualReflection(). |
Definition at line 49 of file qdistinctiterator.cpp.
Referenced by copy().
|
virtual |
Implements QPatternist::SourceLocationReflection.
Definition at line 107 of file qdistinctiterator.cpp.
|
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 102 of file qdistinctiterator.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 92 of file qdistinctiterator.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 62 of file qdistinctiterator.cpp.
|
inline |
Definition at line 109 of file qdistinctiterator_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 97 of file qdistinctiterator.cpp.
|
private |
Definition at line 116 of file qdistinctiterator_p.h.
|
private |
Definition at line 118 of file qdistinctiterator_p.h.
|
private |
Definition at line 117 of file qdistinctiterator_p.h.
Referenced by actualReflection(), and copy().
|
private |
Definition at line 119 of file qdistinctiterator_p.h.
Referenced by next(), and position().
|
private |
Definition at line 120 of file qdistinctiterator_p.h.
Referenced by next().
|
private |
Definition at line 115 of file qdistinctiterator_p.h.