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

ThreadWeaver

  • ThreadWeaver
  • JobCollectionJobRunner
Public Member Functions | List of all members
ThreadWeaver::JobCollectionJobRunner Class Reference

#include <JobCollection_p.h>

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

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
 

Additional Inherited Members

- Signals inherited from ThreadWeaver::Job
void done (ThreadWeaver::Job *)
 
void failed (ThreadWeaver::Job *)
 
void started (ThreadWeaver::Job *)
 
- Protected Member Functions inherited from ThreadWeaver::Job
void freeQueuePolicyResources ()
 
void setFinished (bool status)
 
Thread * thread ()
 
- Protected Attributes inherited from ThreadWeaver::Job
Private * d
 

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
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:53 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

ThreadWeaver

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal