clang-tools 8.0.0

Public Member Functions | Static Public Member Functions | List of all members
clang::clangd::dex::Dex Class Reference

In-memory Dex trigram-based index implementation. More...

`#include <Dex.h>`

Inheritance diagram for clang::clangd::dex::Dex:
[legend]
Collaboration diagram for clang::clangd::dex::Dex:
[legend]

## Public Member Functions
template<typename SymbolRange , typename RefsRange >
| Dex (SymbolRange &&Symbols, RefsRange &&Refs)
template<typename SymbolRange , typename RefsRange , typename Payload >
| Dex (SymbolRange &&Symbols, RefsRange &&Refs, Payload &&BackingData, size_t BackingDataSize)
bool | fuzzyFind (const FuzzyFindRequest &Req, llvm::function_ref< void(const Symbol &)> Callback) const override
| Constructs iterators over tokens extracted from the query and exhausts it while applying Callback to each symbol in the order of decreasing quality of the matched symbols. More...
void | lookup (const LookupRequest &Req, llvm::function_ref< void(const Symbol &)> Callback) const override
| Looks up symbols with any of the given symbol IDs and applies `Callback` on each matched symbol. More...
void | refs (const RefsRequest &Req, llvm::function_ref< void(const Ref &)> Callback) const override
| Finds all occurrences (e.g. More...
size_t | estimateMemoryUsage () const override
| Returns estimated size of index (in bytes). More...
Public Member Functions inherited from clang::clangd::SymbolIndex
virtual | ~SymbolIndex ()=default

## Static Public Member Functions
static std::unique_ptr< SymbolIndex > | build (SymbolSlab, RefSlab)
| Builds an index from slabs. The index takes ownership of the slab. More...

## Detailed Description

In-memory Dex trigram-based index implementation.

Definition at line 42 of file Dex.h.

## Constructor & Destructor Documentation

## ◆ Dex() [1/2]

template<typename SymbolRange , typename RefsRange >

clang::clangd::dex::Dex::Dex | ( | SymbolRange && | Symbols,
|  | RefsRange && | Refs
| ) |  |
| inline

Definition at line 46 of file Dex.h.

## ◆ Dex() [2/2]

template<typename SymbolRange , typename RefsRange , typename Payload >

clang::clangd::dex::Dex::Dex | ( | SymbolRange && | Symbols,
|  | RefsRange && | Refs,
|  | Payload && | BackingData,
|  | size_t | BackingDataSize
| ) |  |
| inline

Definition at line 55 of file Dex.h.

References build(), estimateMemoryUsage(), fuzzyFind(), lookup(), and refs().

## Member Function Documentation

## ◆ build()

std::unique_ptr< SymbolIndex > clang::clangd::dex::Dex::build | ( | SymbolSlab | Symbols,
|  | RefSlab | Refs
| ) |  |
| static

Builds an index from slabs. The index takes ownership of the slab.

Definition at line 27 of file Dex.cpp.

Referenced by Dex().

## ◆ estimateMemoryUsage()

size_t clang::clangd::dex::Dex::estimateMemoryUsage | ( |  | ) | const
| override virtual

Returns estimated size of index (in bytes).

Implements clang::clangd::SymbolIndex.

Definition at line 250 of file Dex.cpp.

Referenced by Dex().

## ◆ fuzzyFind()

bool clang::clangd::dex::Dex::fuzzyFind | ( | const FuzzyFindRequest & | Req,
|  | llvm::function_ref< void(const Symbol &)> | Callback
| ) |  | const
| override virtual

Constructs iterators over tokens extracted from the query and exhausts it while applying Callback to each symbol in the order of decreasing quality of the matched symbols.

Implements clang::clangd::SymbolIndex.

Definition at line 148 of file Dex.cpp.

References clang::clangd::FuzzyFindRequest::Query.

Referenced by Dex().

## ◆ lookup()

void clang::clangd::dex::Dex::lookup | ( | const LookupRequest & | Req,
|  | llvm::function_ref< void(const Symbol &)> | Callback
| ) |  | const
| override virtual

Looks up symbols with any of the given symbol IDs and applies `Callback` on each matched symbol.

The returned symbol must be deep-copied if it's used outside Callback.

Implements clang::clangd::SymbolIndex.

Definition at line 226 of file Dex.cpp.

Referenced by Dex().

## ◆ refs()

void clang::clangd::dex::Dex::refs | ( | const RefsRequest & | Req,
|  | llvm::function_ref< void(const Ref &)> | Callback
| ) |  | const
| override virtual

Finds all occurrences (e.g.

references, declarations, definitions) of a symbol and applies `Callback` on each result.

Results should be returned in arbitrary order. The returned result must be deep-copied if it's used outside Callback.

Implements clang::clangd::SymbolIndex.

Definition at line 236 of file Dex.cpp.

Referenced by Dex().

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

- Dex.h
- Dex.cpp