kdevplatform/language/backgroundparser
#include <backgroundparser.h>

Public Types | |
enum | { BestPriority = -10000, NormalPriority = 0, InitialParsePriority = 10000, WorstPriority = 100000 } |
Public Slots | |
void | abortAllJobs () |
void | addDocument (const IndexedString &url, TopDUContext::Features features=TopDUContext::VisibleDeclarationsAndContexts, int priority=0, QObject *notifyWhenReady=nullptr, ParseJob::SequentialProcessingFlags flags=ParseJob::IgnoresSequentialProcessing, int delay_ms=ILanguageSupport::DefaultDelay) |
void | disableProcessing () |
void | documentClosed (KDevelop::IDocument *) |
void | documentLoaded (KDevelop::IDocument *) |
void | documentUrlChanged (KDevelop::IDocument *) |
void | enableProcessing () |
bool | isIdle () const |
bool | isQueued (const IndexedString &url) const |
void | loadSettings () |
void | parseDocuments () |
int | priorityForDocument (const IndexedString &url) const |
int | queuedCount () const |
void | removeDocument (const IndexedString &url, QObject *notifyWhenReady=nullptr) |
void | resume () |
void | revertAllRequests (QObject *notifyWhenReady) |
void | setNeededPriority (int priority) |
void | suspend () |
void | updateProgressData () |
Signals | |
void | clearMessage (KDevelop::IStatus *) override |
void | hideProgress (KDevelop::IStatus *) override |
void | parseJobFinished (KDevelop::ParseJob *job) |
void | showErrorMessage (const QString &, int) override |
void | showMessage (KDevelop::IStatus *, const QString &message, int timeout=0) override |
void | showProgress (KDevelop::IStatus *, int minimum, int maximum, int value) override |
Public Member Functions | |
BackgroundParser (ILanguageController *languageController) | |
~BackgroundParser () override | |
QList< IndexedString > | managedDocuments () |
ParseJob * | parseJobForDocument (const IndexedString &document) const |
void | setDelay (int milliseconds) |
void | setThreadCount (int threadCount) |
QString | statusName () const override |
int | threadCount () const |
DocumentChangeTracker * | trackerForUrl (const IndexedString &url) const |
bool | waitForIdle () const |
![]() | |
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 |
Protected Slots | |
void | aboutToQuit () |
void | parseComplete (const ThreadWeaver::JobPointer &job) |
void | parseProgress (KDevelop::ParseJob *, float value, const QString &text) |
void | startTimer (int delay) |
void | updateProgressBar () |
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
This class handles the creation of parse jobs for given file URLs.
For performance reasons you must always use clean, canonical URLs. If you do not do that, issues might arise (and the debug build will assert).
Definition at line 53 of file backgroundparser.h.
Member Enumeration Documentation
◆ anonymous enum
anonymous enum |
Definition at line 66 of file backgroundparser.h.
Constructor & Destructor Documentation
◆ BackgroundParser()
|
explicit |
Definition at line 513 of file backgroundparser.cpp.
◆ ~BackgroundParser()
|
override |
Definition at line 547 of file backgroundparser.cpp.
Member Function Documentation
◆ abortAllJobs
|
slot |
Aborts all parse jobs.
Definition at line 759 of file backgroundparser.cpp.
◆ aboutToQuit
|
protectedslot |
Definition at line 540 of file backgroundparser.cpp.
◆ addDocument
|
slot |
Queues up the url
to be parsed.
features
The minimum features that should be computed for this top-context priority
A value that manages the order of parsing. Documents with lowest priority are parsed first.
- Parameters
-
notifyWhenReady An optional pointer to a QObject that should contain a slot "void updateReady(KDevelop::IndexedString url, KDevelop::ReferencedTopDUContext topContext)". The notification is guaranteed to be called once for each call to addDocument. The given top-context may be invalid if the update failed. flags Flags indicating how the document should be treated in the queue delay_ms The delay in milliseconds to add the job with, or one of the values of the ILanguageSupport::ReparseDelaySpecialValues enum.
Definition at line 601 of file backgroundparser.cpp.
◆ clearMessage
|
overridesignal |
◆ disableProcessing
|
slot |
Disables all processing of new jobs, equivalent to setNeededPriority(BestPriority)
Definition at line 706 of file backgroundparser.cpp.
◆ documentClosed
|
slot |
Definition at line 911 of file backgroundparser.cpp.
◆ documentLoaded
|
slot |
Definition at line 939 of file backgroundparser.cpp.
◆ documentUrlChanged
|
slot |
Definition at line 969 of file backgroundparser.cpp.
◆ enableProcessing
|
slot |
Enables all processing of new jobs, equivalent to setNeededPriority(WorstPriority)
Definition at line 711 of file backgroundparser.cpp.
◆ hideProgress
|
overridesignal |
◆ isIdle
|
slot |
Returns true if there are no jobs running nor queued anywhere.
Definition at line 742 of file backgroundparser.cpp.
◆ isQueued
|
slot |
Returns true if the given url is queued for parsing.
Definition at line 725 of file backgroundparser.cpp.
◆ loadSettings
|
slot |
Definition at line 557 of file backgroundparser.cpp.
◆ managedDocuments()
QList< IndexedString > BackgroundParser::managedDocuments | ( | ) |
Returns all documents that were added through addManagedTopRange.
This is typically the currently open documents.
Definition at line 858 of file backgroundparser.cpp.
◆ parseComplete
|
protectedslot |
Definition at line 681 of file backgroundparser.cpp.
◆ parseDocuments
|
slot |
Forces the current queue to be parsed.
Definition at line 668 of file backgroundparser.cpp.
◆ parseJobFinished
|
signal |
Emitted whenever a document parse-job has finished.
The job contains the du-chain(if one was created) etc.
The job is deleted after this signal has been emitted. Receivers should not hold references to it.
Note that if you want to be get updated for all DUChain updates, use DUChain::updateReady instead, as a single ParseJob may update multiple DUChain top contexts.
- See also
- DUChain::updateReady
◆ parseJobForDocument()
ParseJob * BackgroundParser::parseJobForDocument | ( | const IndexedString & | document | ) | const |
Queries the background parser as to whether there is currently a parse job for document
, and if so, returns it.
This may not contain all of the parse jobs that are intended unless you call in from your job's ThreadWeaver::Job::aboutToBeQueued() function.
Definition at line 820 of file backgroundparser.cpp.
◆ parseProgress
|
protectedslot |
Definition at line 564 of file backgroundparser.cpp.
◆ priorityForDocument
|
slot |
Retrieve the current priority for the given URL.
You need to check whether
- Parameters
-
url is queued before calling this function.
Definition at line 716 of file backgroundparser.cpp.
◆ queuedCount
|
slot |
Returns the number of queued jobs (not yet running nor submitted to ThreadWeaver)
Definition at line 734 of file backgroundparser.cpp.
◆ removeDocument
|
slot |
Removes the url
that is registered for the given notification from the url.
- Parameters
-
notifyWhenReady Notifier the document was added with.
Definition at line 638 of file backgroundparser.cpp.
◆ resume
|
slot |
Resumes execution of the background parser.
NOTE: Only the Core should call this
Definition at line 777 of file backgroundparser.cpp.
◆ revertAllRequests
|
slot |
Reverts all requests that were made for the given notification-target.
priorities and requested features will be reverted as well. When notifyWhenReady
is set to a nullptr, all requests will be reverted.
Definition at line 574 of file backgroundparser.cpp.
◆ setDelay()
void BackgroundParser::setDelay | ( | int | milliseconds | ) |
Set the delay in milliseconds before the background parser starts parsing.
Definition at line 848 of file backgroundparser.cpp.
◆ setNeededPriority
|
slot |
Disables processing for all jobs that have a worse priority than priority
This can be used to temporarily limit the processing to only the most important jobs.
To only enable processing for important jobs, call setNeededPriority(0). This should only be used to temporarily alter the processing. A progress-bar will still be shown for the not yet processed jobs.
Definition at line 750 of file backgroundparser.cpp.
◆ setThreadCount()
void BackgroundParser::setThreadCount | ( | int | threadCount | ) |
Set how many ThreadWeaver threads the background parser should set up and use.
Definition at line 831 of file backgroundparser.cpp.
◆ showErrorMessage
|
overridesignal |
◆ showMessage
|
overridesignal |
◆ showProgress
|
overridesignal |
◆ startTimer
|
protectedslot |
Definition at line 978 of file backgroundparser.cpp.
◆ statusName()
|
override |
Definition at line 552 of file backgroundparser.cpp.
◆ suspend
|
slot |
Suspends execution of the background parser.
NOTE: Only the Core should call this
Definition at line 768 of file backgroundparser.cpp.
◆ threadCount()
int BackgroundParser::threadCount | ( | ) | const |
Return how many ThreadWeaver threads the background parser should set up and use.
Definition at line 841 of file backgroundparser.cpp.
◆ trackerForUrl()
DocumentChangeTracker * BackgroundParser::trackerForUrl | ( | const IndexedString & | url | ) | const |
Returns the tracker for the given url if the document is being tracked, else returns zero.
This function is thread-safe, but the returned object also isn't, so you must not use it when you're in a background thread without the foreground lock acquired.
Definition at line 893 of file backgroundparser.cpp.
◆ updateProgressBar
|
protectedslot |
Definition at line 1008 of file backgroundparser.cpp.
◆ updateProgressData
|
slot |
Definition at line 785 of file backgroundparser.cpp.
◆ waitForIdle()
bool BackgroundParser::waitForIdle | ( | ) | const |
Definition at line 866 of file backgroundparser.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Mar 8 2021 23:29:35 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.