language/duchain
KDevelop::DUContextDynamicData Class Reference
This class contains data that is only runtime-dependant and does not need to be stored to disk. More...
#include <ducontextdata.h>
Classes | |
| struct | ImportsHash_Op |
| This can deal with endless recursion. More... | |
Public Types | |
|
typedef QMultiHash< Identifier, DeclarationPointer > | DeclarationsHash |
|
typedef google::dense_hash_map < const DUContextDynamicData *, bool, ImportsHash_Op > | ImportsHash |
Public Member Functions | |
| DUContextDynamicData (DUContext *) | |
| void | addChildContext (DUContext *context) |
| void | addDeclaration (Declaration *declaration) |
| void | addDeclarationToHash (const Identifier &identifer, Declaration *declaration) |
| void | addImportedChildContext (DUContext *context) |
| void | disableLocalDeclarationsHash () |
| void | enableLocalDeclarationsHash (DUContext *ctx, const Identifier ¤tIdentifier=Identifier(), Declaration *currentDecl=0) |
| bool | imports (const DUContext *context, const TopDUContext *source, int maxDepth) const |
| bool | importsSafeButSlow (const DUContext *context, const TopDUContext *source, ImportsHash &checked) const |
| bool | needsLocalDeclarationsHash () |
| bool | removeChildContext (DUContext *context) |
| bool | removeDeclaration (Declaration *declaration) |
| void | removeDeclarationFromHash (const Identifier &identifer, Declaration *declaration) |
| void | removeImportedChildContext (DUContext *context) |
| void | scopeIdentifier (bool includeClasses, QualifiedIdentifier &target) const |
Public Attributes | |
| DUContext * | m_context |
| bool | m_hasLocalDeclarationsHash |
| uint | m_indexInTopContext |
| DeclarationsHash | m_localDeclarationsHash |
| DUContextPointer | m_parentContext |
| bool | m_rangesChanged: 1 |
| QVector < KTextEditor::SmartRange * > | m_rangesForUses |
| TopDUContext * | m_topContext |
Static Public Attributes | |
| static QMutex | m_localDeclarationsMutex |
Detailed Description
This class contains data that is only runtime-dependant and does not need to be stored to disk.
Definition at line 91 of file ducontextdata.h.
Member Function Documentation
| void KDevelop::DUContextDynamicData::addChildContext | ( | DUContext * | context | ) |
Adds a child context.
- Note:
- Be sure to have set the text location first, so that the chain is sorted correctly.
- Todo:
- Do binary search to find the position
Definition at line 427 of file ducontext.cpp.
| void KDevelop::DUContextDynamicData::addDeclaration | ( | Declaration * | declaration | ) |
- Todo:
- Do binary search to find the position
Definition at line 360 of file ducontext.cpp.
| void KDevelop::DUContextDynamicData::addDeclarationToHash | ( | const Identifier & | identifer, | |
| Declaration * | declaration | |||
| ) |
This propagates the declaration into the parent search-hashes, up to the first parent that has m_propagateDeclarations set to false.
Must be called with m_localDeclarationsMutex locked
Definition at line 336 of file ducontext.cpp.
| void KDevelop::DUContextDynamicData::enableLocalDeclarationsHash | ( | DUContext * | ctx, | |
| const Identifier & | currentIdentifier = Identifier(), |
|||
| Declaration * | currentDecl = 0 | |||
| ) |
Adds all declarations that should be in the hash into the hash.
Definition at line 286 of file ducontext.cpp.
| bool KDevelop::DUContextDynamicData::imports | ( | const DUContext * | context, | |
| const TopDUContext * | source, | |||
| int | maxDepth | |||
| ) | const |
Returns true if this context is imported by the given one, on any level.
Definition at line 139 of file ducontext.cpp.
| bool KDevelop::DUContextDynamicData::needsLocalDeclarationsHash | ( | ) |
- Todo:
- Do this again, it brings a large performance boost
Definition at line 313 of file ducontext.cpp.
| bool KDevelop::DUContextDynamicData::removeChildContext | ( | DUContext * | context | ) |
Removes the context from childContexts.
- Returns:
- Whether a context was removed
Definition at line 474 of file ducontext.cpp.
| bool KDevelop::DUContextDynamicData::removeDeclaration | ( | Declaration * | declaration | ) |
Removes the declaration from localDeclarations.
- Returns:
- Whether a declaration was removed
Definition at line 406 of file ducontext.cpp.
| void KDevelop::DUContextDynamicData::removeDeclarationFromHash | ( | const Identifier & | identifer, | |
| Declaration * | declaration | |||
| ) |
Must be called with m_localDeclarationsMutex locked.
Definition at line 348 of file ducontext.cpp.
Member Data Documentation
- Warning:
- : Whenever m_localDeclarations is read or written, m_localDeclarationsHash must be locked.
Definition at line 112 of file ducontextdata.h.
QVector<KTextEditor::SmartRange*> KDevelop::DUContextDynamicData::m_rangesForUses [mutable] |
If this document is loaded, this contains a smart-range for each use.
This may temporarily contain zero ranges.
Definition at line 120 of file ducontextdata.h.
The documentation for this class was generated from the following files:
KDE 4.4 API Reference