kdevplatform/language/duchain
#include <usescollector.h>

Signals | |
void | maximumProgressSignal (uint) |
void | processUsesSignal (const KDevelop::ReferencedTopDUContext &) |
void | progressSignal (uint, uint) |
Public Member Functions | |
UsesCollector (IndexedDeclaration declaration) | |
~UsesCollector () override | |
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 (const IndexedString &url) |
void | startCollecting () |
![]() | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
virtual | ~QObject () |
bool | blockSignals (bool block) |
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
const QObjectList & | children () const |
const char * | className () const |
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *receiver, const char *method) |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) const |
QList< T > | findChildren (const QString &name) const |
bool | inherits (const char *className) const |
void | insertChild (QObject *object) |
void | installEventFilter (QObject *filterObj) |
bool | isA (const char *className) const |
bool | isWidgetType () const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () const |
QVariant | property (const char *name) const |
void | removeChild (QObject *object) |
void | removeEventFilter (QObject *obj) |
void | setName (const char *name) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval) |
QThread * | thread () const |
Additional Inherited Members | |
![]() | |
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
![]() | |
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const char *signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const char *signal) |
int | receivers (const char *signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
![]() | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
![]() | |
objectName | |
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 33 of file usescollector.h.
Constructor & Destructor Documentation
◆ UsesCollector()
|
explicit |
Definition at line 339 of file usescollector.cpp.
◆ ~UsesCollector()
|
override |
Definition at line 347 of file usescollector.cpp.
Member Function Documentation
◆ declaration()
IndexedDeclaration UsesCollector::declaration | ( | ) | const |
- Warning
- For most tasks, you should use declarations() instead, and respect all of them!
Definition at line 475 of file usescollector.cpp.
◆ declarations()
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 117 of file usescollector.cpp.
◆ isReady()
bool UsesCollector::isReady | ( | ) | const |
Definition at line 122 of file usescollector.cpp.
◆ maximumProgressSignal
|
signal |
- See also
- maximumProgress()
◆ processUsesSignal
|
signal |
- See also
- processUses()
◆ progressSignal
|
signal |
- See also
- progress()
◆ setCollectConstructors()
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 97 of file usescollector.cpp.
◆ setCollectDefinitions()
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 112 of file usescollector.cpp.
◆ setCollectOverloads()
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 107 of file usescollector.cpp.
◆ setProcessDeclarations()
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 102 of file usescollector.cpp.
◆ shouldRespectFile()
|
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 127 of file usescollector.cpp.
◆ startCollecting()
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 145 of file usescollector.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Jan 21 2021 23:35:47 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.