clang-tools  7.0.0
Public Member Functions | Friends | List of all members
clang::clangd::dex::Iterator Class Referenceabstract

Iterator is the interface for Query Tree node. More...

#include <Iterator.h>

Public Member Functions

virtual bool reachedEnd () const =0
 Returns true if all valid DocIDs were processed and hence the iterator is exhausted. More...
 
virtual void advance ()=0
 Moves to next valid DocID. More...
 
virtual void advanceTo (DocID ID)=0
 Moves to the first valid DocID which is equal or higher than given ID. More...
 
virtual DocID peek () const =0
 Returns the current element this iterator points to. More...
 
virtual ~Iterator ()
 

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: More...
 

Detailed Description

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 60 of file Iterator.h.

Constructor & Destructor Documentation

◆ ~Iterator()

virtual clang::clangd::dex::Iterator::~Iterator ( )
inlinevirtual

Definition at line 85 of file Iterator.h.

Member Function Documentation

◆ advance()

virtual void clang::clangd::dex::Iterator::advance ( )
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().

◆ advanceTo()

virtual void clang::clangd::dex::Iterator::advanceTo ( DocID  ID)
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.

◆ peek()

virtual DocID clang::clangd::dex::Iterator::peek ( ) const
pure virtual

Returns the current element this iterator points to.

Note: reachedEnd() must be false.

Referenced by clang::clangd::dex::consume().

◆ reachedEnd()

virtual bool clang::clangd::dex::Iterator::reachedEnd ( ) const
pure virtual

Returns true if all valid DocIDs were processed and hence the iterator is exhausted.

Referenced by clang::clangd::dex::consume().

Friends And Related Function Documentation

◆ operator<<

llvm::raw_ostream& operator<< ( llvm::raw_ostream &  OS,
const Iterator Iterator 
)
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 "[ID1, ID2, ...]" where IDN is N-th PostingList entry.

Definition at line 95 of file Iterator.h.


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