clang-tools 22.0.0git
clang::clangd::FeatureModuleSet Class Reference

A FeatureModuleSet is a collection of feature modules installed in clangd. More...

#include <FeatureModule.h>

Public Types

using iterator = llvm::pointee_iterator<decltype(Modules)::iterator>
using const_iterator

Public Member Functions

 FeatureModuleSet ()=default
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
void add (std::unique_ptr< FeatureModule > M)
template<typename Mod>
bool add (std::unique_ptr< Mod > M)
template<typename Mod>
Mod * get ()
template<typename Mod>
const Mod * get () const

Static Public Member Functions

static FeatureModuleSet fromRegistry ()

Detailed Description

A FeatureModuleSet is a collection of feature modules installed in clangd.

Modules added with explicit type specification can be looked up by type, or used via the FeatureModule interface. This allows individual modules to expose a public API. For this reason, there can be only one feature module of each type.

Modules added using a base class pointer can be used only via the FeatureModule interface and can't be looked up by type, thus custom public API (if provided by the module) can't be used.

The set owns the modules. It is itself owned by main, not ClangdServer.

Definition at line 157 of file FeatureModule.h.

Member Typedef Documentation

◆ const_iterator

Initial value:
llvm::pointee_iterator<decltype(Modules)::const_iterator>
llvm::pointee_iterator< decltype(Modules)::const_iterator > const_iterator

Definition at line 176 of file FeatureModule.h.

◆ iterator

using clang::clangd::FeatureModuleSet::iterator = llvm::pointee_iterator<decltype(Modules)::iterator>

Definition at line 175 of file FeatureModule.h.

Constructor & Destructor Documentation

◆ FeatureModuleSet()

clang::clangd::FeatureModuleSet::FeatureModuleSet ( )
default

References FeatureModuleSet().

Referenced by FeatureModuleSet(), fromRegistry(), and get().

Member Function Documentation

◆ add() [1/2]

void clang::clangd::FeatureModuleSet::add ( std::unique_ptr< FeatureModule > M)

Definition at line 25 of file FeatureModule.cpp.

Referenced by fromRegistry().

◆ add() [2/2]

template<typename Mod>
bool clang::clangd::FeatureModuleSet::add ( std::unique_ptr< Mod > M)
inline

Definition at line 184 of file FeatureModule.h.

◆ begin() [1/2]

iterator clang::clangd::FeatureModuleSet::begin ( )
inline

Definition at line 178 of file FeatureModule.h.

Referenced by clang::clangd::clangdMain().

◆ begin() [2/2]

const_iterator clang::clangd::FeatureModuleSet::begin ( ) const
inline

Definition at line 180 of file FeatureModule.h.

◆ end() [1/2]

iterator clang::clangd::FeatureModuleSet::end ( )
inline

Definition at line 179 of file FeatureModule.h.

Referenced by clang::clangd::clangdMain().

◆ end() [2/2]

const_iterator clang::clangd::FeatureModuleSet::end ( ) const
inline

Definition at line 181 of file FeatureModule.h.

◆ fromRegistry()

FeatureModuleSet clang::clangd::FeatureModuleSet::fromRegistry ( )
static

Definition at line 40 of file FeatureModule.cpp.

References add(), FeatureModuleSet(), and clang::clangd::vlog().

Referenced by clang::clangd::clangdMain().

◆ get() [1/2]

template<typename Mod>
Mod * clang::clangd::FeatureModuleSet::get ( )
inline

Definition at line 187 of file FeatureModule.h.

Referenced by get().

◆ get() [2/2]

template<typename Mod>
const Mod * clang::clangd::FeatureModuleSet::get ( ) const
inline

Definition at line 190 of file FeatureModule.h.

References FeatureModuleSet(), and get().


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