language/duchain
KDevelop::Use Class Reference
Represents a position in a document where a specific declaration is used. More...
#include <use.h>
Public Member Functions | |
| Use (const SimpleRange &range=SimpleRange::invalid(), int declarationIndex=std::numeric_limits< int >::max()) | |
| Declaration * | usedDeclaration (TopDUContext *topContext) |
Public Attributes | |
| int | m_declarationIndex |
| SimpleRange | m_range |
Detailed Description
Represents a position in a document where a specific declaration is used.
Since we want to build uses for all files, and every single function may contain tens to hundreds of uses, uses must be extremely light-weight.
For that reason they are built in a way that a use can completely be stored in a simple vector, and they only contain indices that represent the actual declaration used. Since the same Declarations are used over and over again, the actual declarations are stored and indexed centrally in the enclosing top-context. Additionally, because a use may refer to a not globally adressable item, each top-context contains a local map that maps declaration-indices to local decarations.
Since only a small fraction of all files is loaded as document at any time, only few documents actually need smart-ranges. For that reason we do not store them here, but instead only map them to the uses when there actually IS smart-ranges for them.
Definition at line 48 of file use.h.
The documentation for this class was generated from the following files:
KDE 4.4 API Reference