kdevplatform/language/duchain
#include <importers.h>
Public Member Functions | |
Importers () | |
~Importers () | |
void | addImporter (const DeclarationId &id, const IndexedDUContext &use) |
KDevVarLengthArray< IndexedDUContext > | importers (const DeclarationId &id) const |
void | removeImporter (const DeclarationId &id, const IndexedDUContext &use) |
Static Public Member Functions | |
static Importers & | self () |
Detailed Description
Global mapping of Declaration-Ids to contexts that import the associated context, protected through DUChainLock.
This is used as an alternative to the local importers list within DUContext, only for indirect imports(Across different files, or with templates).
This has the advantage that imports stay valid even if the imported context is deleted temporarily, and stored top-contexts don't need to be changed just because imports were added.
To retrieve the actual uses, query the duchain for the files.
Definition at line 41 of file importers.h.
Constructor & Destructor Documentation
◆ Importers()
KDevelop::Importers::Importers | ( | ) |
Constructor.
Definition at line 129 of file importers.cpp.
◆ ~Importers()
|
default |
Destructor.
Member Function Documentation
◆ addImporter()
void KDevelop::Importers::addImporter | ( | const DeclarationId & | id, |
const IndexedDUContext & | use | ||
) |
Adds a top-context to the users-list of the given id.
Definition at line 136 of file importers.cpp.
◆ importers()
KDevVarLengthArray< IndexedDUContext > KDevelop::Importers::importers | ( | const DeclarationId & | id | ) | const |
Gets the top-contexts of all users assigned to the declaration-id.
Definition at line 189 of file importers.cpp.
◆ removeImporter()
void KDevelop::Importers::removeImporter | ( | const DeclarationId & | id, |
const IndexedDUContext & | use | ||
) |
Removes the given top-context from the list of uses.
Definition at line 163 of file importers.cpp.
◆ self()
|
static |
Definition at line 210 of file importers.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Mar 4 2021 23:31:18 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.