kitchensync Library API Documentation

Threaded::ClientManager Class Reference

Client Thread. More...

#include <clientmanager.h>

Inheritance diagram for Threaded::ClientManager:

Inheritance graph
[legend]
Collaboration diagram for Threaded::ClientManager:

Collaboration graph
[legend]
List of all members.

Signals

void signalTerminated ()
void signalFinished ()
void signalError (const KSync::Error &)
void signalProgress (const KSync::Progress &)

Public Member Functions

 ClientManager (QObject *=0, const char *=0)
 ~ClientManager ()
bool isIdle ()
bool readSyncees ()
bool writeSyncees ()
bool connectDevice ()
bool disconnectDevice ()
bool terminateThread ()
void cancelJob ()

Detailed Description

Client Thread.

A QThread for the OBEX client. Note that this QObject is only accessed from the main thread. It is used to report events from the working thread.

Definition at line 44 of file clientmanager.h.


Constructor & Destructor Documentation

ClientManager::ClientManager QObject = 0,
const char *  = 0
 

Constructor with the usual parent handling.

Definition at line 37 of file clientmanager.cpp.

References Threaded::ClientThread::mLock.

ClientManager::~ClientManager  ) 
 

Destructor, make sure that the thread terminated.

Definition at line 47 of file clientmanager.cpp.

References terminateThread().


Member Function Documentation

bool ClientManager::isIdle  ) 
 

Returns if the worker is idel at the monment.

Since we have only one manager this lock free access does not introduce a race condition.

Definition at line 77 of file clientmanager.cpp.

References Threaded::ClientThread::mLock.

bool ClientManager::readSyncees  ) 
 

Starts reading the device and computing the synccees.

Returns if a backup could be started. If the function returns with true the job is terminated by by either a signalError( const KSync::Error& ) or a signalFinished( const KSync::Progress& ).

Definition at line 88 of file clientmanager.cpp.

References Threaded::ClientThread::mCommand, Threaded::ClientThread::mLock, Threaded::ClientThread::mWait, and QWaitCondition::wakeOne().

Referenced by Threaded::ThreadedPlugin::readSyncees().

bool ClientManager::writeSyncees  ) 
 

Starts writing the syncees to the device.

Returns if a backup could be started. If the function returns with true the job is terminated by by either a signalError( const KSync::Error& ) or a signalFinished( const KSync::Progress& ).

Definition at line 106 of file clientmanager.cpp.

References Threaded::ClientThread::mCommand, Threaded::ClientThread::mLock, Threaded::ClientThread::mWait, and QWaitCondition::wakeOne().

Referenced by Threaded::ThreadedPlugin::writeSyncees().

bool ClientManager::connectDevice  ) 
 

Starts connecting the device.

Returns if a backup could be started. If the function returns with true the job is terminated by by either a signalError( const KSync::Error& ) or a signalFinished( const KSync::Progress& ).

Definition at line 125 of file clientmanager.cpp.

References Threaded::ClientThread::mCommand, Threaded::ClientThread::mLock, Threaded::ClientThread::mWait, and QWaitCondition::wakeOne().

Referenced by Threaded::ThreadedPlugin::connectDevice().

bool ClientManager::disconnectDevice  ) 
 

Starts disconnecting the device.

Returns if a backup could be started. If the function returns with true the job is terminated by by either a signalError( const KSync::Error& ) or a signalFinished( const KSync::Progress& ).

Definition at line 144 of file clientmanager.cpp.

References Threaded::ClientThread::mCommand, Threaded::ClientThread::mLock, Threaded::ClientThread::mWait, and QWaitCondition::wakeOne().

Referenced by Threaded::ThreadedPlugin::disconnectDevice().

bool ClientManager::terminateThread  ) 
 

Terminates .

.. FIXME, work out if the usual terminate does a better job ...

Definition at line 159 of file clientmanager.cpp.

References Threaded::ClientThread::mCancel, Threaded::ClientThread::mCommand, Threaded::ClientThread::mLock, Threaded::ClientThread::mWait, and QWaitCondition::wakeOne().

Referenced by ~ClientManager().

void ClientManager::cancelJob  ) 
 

Sets a flag in the client thread.

We hope, that the worker thread regularly reads that flag ...

Definition at line 176 of file clientmanager.cpp.

References Threaded::ClientThread::mCancel.

void Threaded::ClientManager::signalTerminated  )  [signal]
 

Is emitted when the thread running has terminated.

Then it is save to destroy this class.

void Threaded::ClientManager::signalFinished  )  [signal]
 

Is emitted when the job running has finished.

void Threaded::ClientManager::signalError const KSync::Error  )  [signal]
 

Is emitted when the thread running main gets an error.

void Threaded::ClientManager::signalProgress const KSync::Progress &   )  [signal]
 

Is emitted when the thread running main gets an error.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kitchensync Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Oct 4 14:41:25 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003