ThreadWeaver
#include <JobCollection_p.h>
Public Member Functions | |
JobCollectionJobRunner (JobCollection *collection, Job *payload, QObject *parent) | |
void | aboutToBeDequeued (WeaverInterface *weaver) |
void | aboutToBeQueued (WeaverInterface *weaver) |
bool | canBeExecuted () |
void | execute (Thread *t) |
Job * | payload () |
int | priority () const |
Public Member Functions inherited from ThreadWeaver::Job | |
Job (QObject *parent=0) | |
virtual | ~Job () |
void | assignQueuePolicy (QueuePolicy *) |
bool | isFinished () const |
void | removeQueuePolicy (QueuePolicy *) |
virtual void | requestAbort () |
virtual bool | success () const |
Public Member Functions inherited from QObject | |
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 QObject *receiver, const char *method) |
bool | disconnect (const char *signal, 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 | |
Signals inherited from ThreadWeaver::Job | |
void | done (ThreadWeaver::Job *) |
void | failed (ThreadWeaver::Job *) |
void | started (ThreadWeaver::Job *) |
Static Public Member Functions inherited from QObject | |
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) |
Protected Member Functions inherited from ThreadWeaver::Job | |
void | freeQueuePolicyResources () |
void | setFinished (bool status) |
Thread * | thread () |
Protected Member Functions inherited from QObject | |
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) |
Static Protected Member Functions inherited from QObject | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
Protected Attributes inherited from ThreadWeaver::Job | |
Private * | d |
Properties inherited from QObject | |
objectName | |
Detailed Description
Definition at line 45 of file JobCollection_p.h.
Constructor & Destructor Documentation
JobCollectionJobRunner::JobCollectionJobRunner | ( | JobCollection * | collection, |
Job * | payload, | ||
QObject * | parent | ||
) |
Definition at line 43 of file JobCollection.cpp.
Member Function Documentation
|
virtual |
This Job is about the be dequeued from the weaver's job queue.
The job will be removed from the queue right after this method returns. Use this method to dequeue, if necessary, sub-operations (jobs) that this job has enqueued.
Note: When this method is called, the associated Weaver object's thread does hold a lock on the weaver's queue.
Note: The default implementation does nothing.
- Parameters
-
weaver the Weaver object from which the job will be dequeued
Reimplemented from ThreadWeaver::Job.
Definition at line 73 of file JobCollection.cpp.
|
virtual |
The job is about to be added to the weaver's job queue.
The job will be added right after this method finished. The default implementation does nothing. Use this method to, for example, queue sub-operations as jobs before the job itself is queued.
Note: When this method is called, the associated Weaver object's thread holds a lock on the weaver's queue. Therefore, it is save to assume that recursive queueing is atomic from the queues perspective.
- Parameters
-
weaver the Weaver object the job will be queued in
Reimplemented from ThreadWeaver::Job.
Definition at line 68 of file JobCollection.cpp.
|
virtual |
canBeExecuted() returns true if all the jobs queue policies agree to it.
If it returns true, it expects that the job is executed right after that. The done() methods of the queue policies will be automatically called when the job is finished.
If it returns false, all queue policy resources have been freed, and the method can be called again at a later time.
Reimplemented from ThreadWeaver::Job.
Definition at line 58 of file JobCollection.cpp.
|
virtual |
Perform the job.
The thread in which this job is executed is given as a parameter. Do not overload this method to create your own Job implementation, overload run().
Reimplemented from ThreadWeaver::Job.
Definition at line 78 of file JobCollection.cpp.
Job * JobCollectionJobRunner::payload | ( | ) |
Definition at line 63 of file JobCollection.cpp.
|
virtual |
The queueing priority of the job.
Jobs will be sorted by their queueing priority when enqueued. A higher queueing priority will place the job in front of all lower-priority jobs in the queue.
Note: A higher or lower priority does not influence queue policies. For example, a high-priority job that has an unresolved dependency will not be executed, which means an available lower-priority job will take precedence.
The default implementation returns zero. Only if this method is overloaded for some job classes, priorities will influence the execution order of jobs.
Reimplemented from ThreadWeaver::Job.
Definition at line 90 of file JobCollection.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:33 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.