clang-tools  15.0.0git
Classes | Namespaces | Typedefs | Functions
Iterator.h File Reference
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <memory>
#include <vector>
Include dependency graph for Iterator.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


class  clang::clangd::dex::Iterator
 Iterator is the interface for Query Tree node. More...
class  clang::clangd::dex::Corpus


 ===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//


using clang::clangd::dex::DocID = uint32_t
 Symbol position in the list of all index symbols sorted by a pre-computed symbol quality. More...


std::vector< std::pair< DocID, float > > clang::clangd::dex::consume (Iterator &It)
 Advances the iterator until it is exhausted. More...
void clang::clangd::dex::detail::populateChildren (std::vector< std::unique_ptr< Iterator >> &)
template<typename... TailT>
void clang::clangd::dex::detail::populateChildren (std::vector< std::unique_ptr< Iterator >> &Children, std::unique_ptr< Iterator > Head, TailT... Tail)

Detailed Description

Symbol index queries consist of specific requirements for the requested symbol, such as high fuzzy matching score, scope, type etc. The lists of all symbols matching some criteria (e.g. belonging to "clang::clangd::" scope) are expressed in a form of Search Tokens which are stored in the inverted index. Inverted index maps these tokens to the posting lists - sorted (by symbol quality) sequences of symbol IDs matching the token, e.g. scope token "clangd::clangd::" is mapped to the list of IDs of all symbols which are declared in this namespace. Search queries are build from a set of requirements which can be combined with each other forming the query trees. The leafs of such trees are posting lists, and the nodes are operations on these posting lists, e.g. intersection or union. Efficient processing of these multi-level queries is handled by Iterators. Iterators advance through all leaf posting lists producing the result of search query, which preserves the sorted order of IDs. Having the resulting IDs sorted is important, because it allows receiving a certain number of the most valuable items (e.g. symbols with highest quality which was the sorting key in the first place) without processing all items with requested properties (this might not be computationally effective if search request is not very restrictive).

Definition in file Iterator.h.