clang-tools 20.0.0git
|
Iterator is the interface for Query Tree node. More...
#include <Iterator.h>
Public Types | |
enum class | Kind { And , Or , True , False , Other } |
Inspect iterator type, used internally for optimizing query trees. More... | |
Public Member Functions | |
virtual bool | reachedEnd () const =0 |
Returns true if all valid DocIDs were processed and hence the iterator is exhausted. | |
virtual void | advance ()=0 |
Moves to next valid DocID. | |
virtual void | advanceTo (DocID ID)=0 |
Moves to the first valid DocID which is equal or higher than given ID. | |
virtual DocID | peek () const =0 |
Returns the current element this iterator points to. | |
virtual float | consume ()=0 |
Informs the iterator that the current document was consumed, and returns its boost. | |
virtual size_t | estimateSize () const =0 |
Returns an estimate of advance() calls before the iterator is exhausted. | |
virtual | ~Iterator () |
Kind | kind () const |
Protected Member Functions | |
Iterator (Kind MyKind=Kind::Other) | |
Friends | |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &OS, const Iterator &Iterator) |
Prints a convenient human-readable iterator representation by recursively dumping iterators in the following format: | |
Iterator is the interface for Query Tree node.
The simplest type of Iterator is DocumentIterator which is simply a wrapper around PostingList iterator and serves as the Query Tree leaf. More sophisticated examples of iterators can manage intersection, union of the elements produced by other iterators (their children) to form a multi-level Query Tree. The interface is designed to be extensible in order to support multiple types of iterators.
Definition at line 53 of file Iterator.h.
|
strong |
Inspect iterator type, used internally for optimizing query trees.
Enumerator | |
---|---|
And | |
Or | |
True | |
False | |
Other |
Definition at line 100 of file Iterator.h.
|
inlinevirtual |
Definition at line 83 of file Iterator.h.
|
inlineprotected |
Definition at line 104 of file Iterator.h.
|
pure virtual |
Moves to next valid DocID.
If it doesn't exist, the iterator is exhausted and proceeds to the END.
Note: reachedEnd() must be false.
Referenced by clang::clangd::dex::consume().
|
pure virtual |
Moves to the first valid DocID which is equal or higher than given ID.
If it doesn't exist, the iterator is exhausted and proceeds to the END.
Note: reachedEnd() must be false.
|
pure virtual |
Informs the iterator that the current document was consumed, and returns its boost.
Note: If this iterator has any child iterators that contain the document, consume() should be called on those and their boosts incorporated. consume() must not be called on children that don't contain the current doc.
Referenced by clang::clangd::dex::consume().
|
pure virtual |
Returns an estimate of advance() calls before the iterator is exhausted.
|
inline |
Definition at line 101 of file Iterator.h.
|
pure virtual |
Returns the current element this iterator points to.
Note: reachedEnd() must be false.
Referenced by clang::clangd::dex::consume().
|
pure virtual |
Returns true if all valid DocIDs were processed and hence the iterator is exhausted.
Referenced by clang::clangd::dex::consume().
|
friend |
Prints a convenient human-readable iterator representation by recursively dumping iterators in the following format:
(Type Child1 Child2 ...)
Where Type is the iterator type representation: "&" for And, "|" for Or, ChildN is N-th iterator child. Raw iterators over PostingList are represented as "[... CurID ...]" where CurID is the current PostingList entry being inspected.
Definition at line 94 of file Iterator.h.