language/duchain
KDevelop::UsesCollector Class Reference
A helper base-class for collecting the top-contexts that contain all uses of a declaration The most important part is that this also updates the duchain if it's not up-to-date or doesn't contain the required features. More...
#include <usescollector.h>

Signals | |
| void | maximumProgressSignal (uint) |
| void | processUsesSignal (KDevelop::ReferencedTopDUContext) |
| void | progressSignal (uint, uint) |
Public Member Functions | |
| UsesCollector (IndexedDeclaration declaration) | |
| IndexedDeclaration | declaration () const |
| QList< IndexedDeclaration > | declarations () |
| bool | isReady () const |
| void | setCollectConstructors (bool process) |
| void | setCollectDefinitions (bool collectDefinition) |
| void | setCollectOverloads (bool collect) |
| void | setProcessDeclarations (bool process) |
| virtual bool | shouldRespectFile (IndexedString url) |
| void | startCollecting () |
Detailed Description
A helper base-class for collecting the top-contexts that contain all uses of a declaration The most important part is that this also updates the duchain if it's not up-to-date or doesn't contain the required features.
The virtual function processUses(..) is called with each up-to-date top-context found that contains uses of the declaration.
Definition at line 34 of file usescollector.h.
Member Function Documentation
| IndexedDeclaration UsesCollector::declaration | ( | ) | const |
- Warning:
- For most tasks, you should use declarations() instead, and respect all of them!
Definition at line 389 of file usescollector.cpp.
| QList< IndexedDeclaration > UsesCollector::declarations | ( | ) |
The declarations that were used as base for the search For classes this contains forward-declarations etc.
- Warning:
- When doing refactoring, you have to respect all of these as possible used declarations, even within the same context. Multiple different of them may have been used in the same top-context, with different local use-indices.
Definition at line 101 of file usescollector.cpp.
| void KDevelop::UsesCollector::maximumProgressSignal | ( | uint | ) | [signal] |
- See also:
- maximumProgress()
| void KDevelop::UsesCollector::processUsesSignal | ( | KDevelop::ReferencedTopDUContext | ) | [signal] |
- See also:
- processUses()
| void KDevelop::UsesCollector::progressSignal | ( | uint | , | |
| uint | ||||
| ) | [signal] |
- See also:
- progress()
| void UsesCollector::setCollectConstructors | ( | bool | process | ) |
If the searched declaration is a class, this can be used to decide whether constructors searched as well.
The constructors and destructors will also be part of the declarations() list. The default is "true". This only works with constructors that have the same name as the class. If this is set to true, also destructors are searched and eventually renamed.
Definition at line 85 of file usescollector.cpp.
| void UsesCollector::setCollectDefinitions | ( | bool | collectDefinition | ) |
If this is true, all definitions are loaded too, and part of the processed declarations.
This also means that the collector will first jump from any definition to its declaration, and start collecting from there. They are also returned in declarations(): The default is "true"
Definition at line 97 of file usescollector.cpp.
| void UsesCollector::setCollectOverloads | ( | bool | collect | ) |
If this is true, the complete overload-chain is computed, and the uses of all overloaded functions together are computed.
They are also returned in declarations(): The default is "true"
Definition at line 93 of file usescollector.cpp.
| void UsesCollector::setProcessDeclarations | ( | bool | process | ) |
Use this to set whether processUses should also be called on contexts that only contain a declaration that was used for searching the uses The default is "true".
Definition at line 89 of file usescollector.cpp.
| bool UsesCollector::shouldRespectFile | ( | IndexedString | url | ) | [virtual] |
Override this to decide whether a file should be respect while computation.
If true is returned, the uses will be computed for this file, and for all files in the import-chain between that file, and the file where the declaration occurs. The default-implementation returns true if the file is part of an open project, or if no project is opened and the file is open in an editor.
Definition at line 109 of file usescollector.cpp.
| void UsesCollector::startCollecting | ( | ) |
This must be called to start the actual collecting!
Collect all overloads into "decls"
- Todo:
- Fail!
Collect all "parsed versions" or forward-declarations etc. here, into allDeclarations
Collect definitions for declarations
Step 4: Copy allDeclarations into m_declarations, build top-context list, etc.
We use ParsingEnvironmentFile to collect all the relevant importers, because loading those is very cheap, compared to loading a whole TopDUContext.
We have all importers now. However since we can tell parse-jobs to also update all their importers, we only need to update the "root" top-contexts that open the whole set with their imports.
- Todo:
- more intelligent
Definition at line 122 of file usescollector.cpp.
The documentation for this class was generated from the following files:
KDE 4.4 API Reference