• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdevelop API Reference
  • KDE Home
  • Contact Us
 

kdevplatform/language/duchain

  • KDevelop
  • SpecializationStore
Public Member Functions | Static Public Member Functions | List of all members
KDevelop::SpecializationStore Class Reference

#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
declarationThe declaration to specialize
sourceThe top-context from where to start searching
recursiveWhether 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
contextThe context to specialize
sourceThe top-context from where to start searching
recursiveWhether 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()

SpecializationStore & KDevelop::SpecializationStore::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:
  • specializationstore.h
  • specializationstore.cpp
This file is part of the KDE documentation.
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.

kdevplatform/language/duchain

Skip menu "kdevplatform/language/duchain"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdevelop API Reference

Skip menu "kdevelop API Reference"
  • kdevplatform
  •   debugger
  •   documentation
  •   interfaces
  •   language
  •     assistant
  •     backgroundparser
  •     checks
  •     classmodel
  •     codecompletion
  •     codegen
  •     duchain
  •     editor
  •     highlighting
  •     interfaces
  •     util
  •   outputview
  •   project
  •   serialization
  •   shell
  •   sublime
  •   tests
  •   util
  •   vcs

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal