libkdepim Library API Documentation

KPIM::ThreadWeaver::Thread Class Reference

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

#include <weaver.h>

Inheritance diagram for KPIM::ThreadWeaver::Thread:

QThread List of all members.

Public Methods

 Thread (Weaver *parent)
 ~Thread ()
void run ()
void msleep (unsigned long msec)
const unsigned int id () const
void post (Event::Action, Job *=0)

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 247 of file weaver.h.


Constructor & Destructor Documentation

KPIM::ThreadWeaver::Thread::Thread Weaver   parent
 

Create a thread.

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

Definition at line 181 of file weaver.cpp.

KPIM::ThreadWeaver::Thread::~Thread  
 

The destructor.

Definition at line 188 of file weaver.cpp.


Member Function Documentation

void KPIM::ThreadWeaver::Thread::run  
 

Overloaded to execute the assigned job.

This will NOT return until shutdown() is called. The thread will try to execute one job after the other, asking the Weaver parent for a new job when the assigned one is finished. If no jobs are available, the thread will suspend. After shutdown() is called, the thread will end as soon as the currently assigned job is done.

Reimplemented from QThread.

Definition at line 205 of file weaver.cpp.

References KPIM::ThreadWeaver::Weaver::applyForWork(), KPIM::ThreadWeaver::Job::execute(), id(), and post().

const unsigned int KPIM::ThreadWeaver::Thread::id   const
 

Returns the thread id.

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

Definition at line 200 of file weaver.cpp.

Referenced by run().

void KPIM::ThreadWeaver::Thread::post Event::Action   ,
Job   = 0
 

Post an event, will be received and processed by the Weaver.

Definition at line 230 of file weaver.cpp.

References KPIM::ThreadWeaver::Weaver::post().

Referenced by run(), KPIM::ThreadWeaver::Job::triggerAPR(), and KPIM::ThreadWeaver::Job::triggerSPR().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for libkdepim Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:36:32 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003