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

ThreadWeaver

ThreadWeaver::Thread

ThreadWeaver::Thread Class Reference

The class Thread is used to represent the worker threads in the weaver's inventory. More...

#include <Thread.h>

Inheritance diagram for ThreadWeaver::Thread:

Inheritance graph
[legend]

List of all members.


Signals

void jobDone (ThreadWeaver::Job *)
void jobStarted (ThreadWeaver::Thread *, ThreadWeaver::Job *)
void started (ThreadWeaver::Thread *)

Public Member Functions

unsigned int id ()
void msleep (unsigned long msec)
void requestAbort ()
void run ()
 Thread (WeaverImpl *parent=0)
 ~Thread ()

Detailed Description

The class Thread is used to represent the worker threads in the weaver's inventory.

It is not meant to be overloaded.

Definition at line 47 of file Thread.h.


Constructor & Destructor Documentation

Thread::Thread ( WeaverImpl *  parent = 0  )  [explicit]

Create a thread.

These thread objects are only used inside the Weaver parent object.

Parameters:
parent the parent WeaverImpl

Definition at line 110 of file Thread.cpp.

Thread::~Thread (  ) 

The destructor.

Definition at line 117 of file Thread.cpp.


Member Function Documentation

unsigned int Thread::id (  ) 

Returns the thread id.

This id marks the respective Thread object, and must therefore not be confused with, e.g., the pthread thread ID.

Generally, the way threads are implemented is not specified. id() is the only way to uniquely identify a thread within ThreadWeaver.

Definition at line 122 of file Thread.cpp.

void ThreadWeaver::Thread::jobDone ( ThreadWeaver::Job *   )  [signal]

The thread finished to execute a job.

void ThreadWeaver::Thread::jobStarted ( ThreadWeaver::Thread *  ,
ThreadWeaver::Job *   
) [signal]

The thread started to process a job.

void Thread::msleep ( unsigned long  msec  ) 

Provide the msleep() method (protected in QThread) to be available for executed jobs.

Parameters:
msec amount of milliseconds

Reimplemented from QThread.

Definition at line 148 of file Thread.cpp.

void Thread::requestAbort (  ) 

Request the abortion of the current job.

If there is no current job, this method will do nothing, but can safely be called. It forwards the request to the current Job.

Definition at line 154 of file Thread.cpp.

void Thread::run (  ) 

Overload to execute the assigned jobs.

Whenever the thread is idle, it will ask its Weaver parent for a Job to do. The Weaver will either return a Job or a Nil pointer. When a Nil pointer is returned, it tells the thread to exit.

Reimplemented from QThread.

Definition at line 127 of file Thread.cpp.

void ThreadWeaver::Thread::started ( ThreadWeaver::Thread *   )  [signal]

The thread has been started.


The documentation for this class was generated from the following files:
  • Thread.h
  • Thread.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
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
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