kdevplatform/language/duchain
#include <specializationstore.h>
Public Member Functions | |
KDevelop::Declaration * | applySpecialization (KDevelop::Declaration *declaration, KDevelop::TopDUContext *source, bool recursive=true) |
DUContext * | applySpecialization (KDevelop::DUContext *context, KDevelop::TopDUContext *source, bool recursive=true) |
void | clear () |
void | clear (const DeclarationId &declaration) |
IndexedInstantiationInformation | get (const DeclarationId &declaration) |
void | set (const DeclarationId &declaration, const IndexedInstantiationInformation &specialization) |
Static Public Member Functions | |
static SpecializationStore & | self () |
Detailed Description
This class allows dynamic management of "current" specializations for declarations.
The specializations will be applied in editors, and wherever it makes sense. For example, this is used in C++ to get code-completion and use-building within instantiated template-classes/functions.
Definition at line 41 of file specializationstore.h.
Member Function Documentation
◆ applySpecialization() [1/2]
Declaration * KDevelop::SpecializationStore::applySpecialization | ( | KDevelop::Declaration * | declaration, |
KDevelop::TopDUContext * | source, | ||
bool | recursive = true |
||
) |
Applies the known specializations for the given declaration using the Declaration::specialize() function.
If no specializations are known, the original declaration is returned.
- Parameters
-
declaration The declaration to specialize source The top-context from where to start searching recursive Whether parent-contexts should be checked for known specializations, and those applied. This is a bit more expensive then just doing a local check.
Definition at line 67 of file specializationstore.cpp.
◆ applySpecialization() [2/2]
DUContext * KDevelop::SpecializationStore::applySpecialization | ( | KDevelop::DUContext * | context, |
KDevelop::TopDUContext * | source, | ||
bool | recursive = true |
||
) |
Applies the known specializations for the given context using the DUContext::specialize() function.
If no specializations are known, returns the original context.
- Parameters
-
context The context to specialize source The top-context from where to start searching recursive Whether parent-contexts should be checked for known specializations, and those applied. This is a bit more expensive then just doing a local check.
Definition at line 96 of file specializationstore.cpp.
◆ clear() [1/2]
void KDevelop::SpecializationStore::clear | ( | ) |
Clears all registered specializations.
Definition at line 62 of file specializationstore.cpp.
◆ clear() [2/2]
void KDevelop::SpecializationStore::clear | ( | const DeclarationId & | declaration | ) |
Clears the specialization registered for the given declaration-id.
Definition at line 55 of file specializationstore.cpp.
◆ get()
IndexedInstantiationInformation KDevelop::SpecializationStore::get | ( | const DeclarationId & | declaration | ) |
Gets the registered specialization for the given declaration-id, or zero.
Definition at line 46 of file specializationstore.cpp.
◆ self()
|
static |
Definition at line 33 of file specializationstore.cpp.
◆ set()
void KDevelop::SpecializationStore::set | ( | const DeclarationId & | declaration, |
const IndexedInstantiationInformation & | specialization | ||
) |
Adds/updates the current specialization for the given declaration-id.
Definition at line 39 of file specializationstore.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2021 The KDE developers.
Generated on Wed Mar 3 2021 00:37:29 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.