7 #ifndef PAUSABLETHREAD_H
8 #define PAUSABLETHREAD_H
12 #include <QtCore/QThread>
13 #include <QtCore/QMutex>
14 #include <QtCore/QWaitCondition>
107 void pause(
bool block=
false);
188 #endif // PAUSABLETHREAD_H
std::out_of_range _outrange_excep
the invalid arguemnt exception thrown
void rethrowException() const
rethrow the thrown exception
status_t _status
the internal status of the thread
void pause(bool block=false)
pause the thread
status_t
enum describing the internal status of the thread
void waitUntilPaused()
waits until thread is paused
QWaitCondition _waitUntilPausedCondition
wait condition to wait unitl thread is paused
std::runtime_error _runt_excep
the invalid arguemnt exception thrown
std::invalid_argument _invarg_excep
the invalid arguemnt exception thrown
PausableThread(control_t control=_run, QObject *parent=0)
constructor
QMutex _pauseMutex
mutex to wait on until thread is paused
std::logic_error _logic_excep
the invalid arguemnt exception thrown
virtual ~PausableThread()
destructor
exception_t _exception_thrown
flag to show that general exception was thrown
exception_t
enum describing which exception was thrown
virtual void end()
tell the thread to quit
bool shouldQuit() const
query whether this thread is told to quit
control_t _control
the internal control status of the thread
void resume()
resume the thread
virtual void runthis()=0
contains the code to run in the thread
control_t
enum describing the control status of the thread
void pausePoint()
point where the thread will be paused
QWaitCondition _pauseCondition
wait condition to wait on until thread is resumed
status_t status() const
return the current status of the thread
exception_t exceptionThrown() const
A QThread that has the ability to be paused and resumed.
size_t _pausecount
a counter how many threads have pause this thread