23 #ifndef WORKERTHREAD_H
24 #define WORKERTHREAD_H
29 #include <QWaitCondition>
32 #include "baseexception.h"
76 BaseException::operator=(other);
93 virtual const char *what()
const throw()
95 return "Unknown exception thrown by a ThreadOperation, cannot provide further information";
115 virtual void stop() = 0;
120 virtual void run() = 0;
136 void addOperation(
ThreadOperation* operation,
bool deleteAtEnd =
true );
138 void stopCurrentOperation();
148 bool operationRunning();
166 void exceptionDuringOperation(BaseException *e);
170 struct ThreadOperationInfo
172 ThreadOperationInfo() :
188 QQueue<ThreadOperationInfo> operations;
192 QWaitCondition waitForOperationsToDo;
194 ThreadOperationInfo operation;
201 QList<BaseException *> exceptions;