• Skip to content
  • Skip to link menu
KDE 4.6 API Reference
  • KDE API Reference
  • kdelibs
  • KDE Home
  • Contact Us
 

ThreadWeaver

  • ThreadWeaver
  • JobCollectionJobRunner
Public Member Functions

ThreadWeaver::JobCollectionJobRunner Class Reference

#include <JobCollection_p.h>

Inheritance diagram for ThreadWeaver::JobCollectionJobRunner:
Inheritance graph
[legend]

List of all members.

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

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

void JobCollectionJobRunner::aboutToBeDequeued ( WeaverInterface *  weaver) [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:
weaverthe Weaver object from which the job will be dequeued

Reimplemented from ThreadWeaver::Job.

Definition at line 73 of file JobCollection.cpp.

void JobCollectionJobRunner::aboutToBeQueued ( WeaverInterface *  weaver) [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:
weaverthe Weaver object the job will be queued in

Reimplemented from ThreadWeaver::Job.

Definition at line 68 of file JobCollection.cpp.

bool JobCollectionJobRunner::canBeExecuted ( ) [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.

void JobCollectionJobRunner::execute ( Thread *  th) [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.

int JobCollectionJobRunner::priority ( ) const [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:
  • JobCollection_p.h
  • JobCollection.cpp

ThreadWeaver

Skip menu "ThreadWeaver"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.7.3
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal