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 );
140 void stopCurrentOperation(
bool wait);
150 bool operationRunning();
168 void exceptionDuringOperation(farsa::BaseException *e);
172 struct ThreadOperationInfo
174 ThreadOperationInfo() :
190 QQueue<ThreadOperationInfo> operations;
194 QWaitCondition waitForOperationsToDo;
196 QWaitCondition waitForOperationsToFinish;
198 ThreadOperationInfo operation;
205 QList<BaseException *> exceptions;