| Line |
Branch |
Decision |
Call |
Exec |
Source |
| 1 |
|
|
|
|
#ifndef CLO3D_BASETASK_H |
| 2 |
|
|
|
|
#define CLO3D_BASETASK_H |
| 3 |
|
|
|
|
|
| 4 |
|
|
|
|
#include "BaseTaskException.h" |
| 5 |
|
|
|
|
|
| 6 |
|
|
|
|
#include <mutex> |
| 7 |
|
|
|
|
#include <functional> |
| 8 |
|
|
|
|
#include <condition_variable> |
| 9 |
|
|
|
|
|
| 10 |
|
|
|
|
#include <QString> |
| 11 |
|
|
|
|
|
| 12 |
|
|
|
|
#include "CLO3DExtensionExport.h" |
| 13 |
|
|
|
|
|
| 14 |
|
|
|
|
template <typename T> |
| 15 |
|
|
|
|
class QFuture; |
| 16 |
|
|
|
|
template <typename T> |
| 17 |
|
|
|
|
class QFutureWatcher; |
| 18 |
|
|
|
|
|
| 19 |
|
|
|
|
namespace CLO3D { |
| 20 |
|
|
|
|
class CLO3D_EXTENSION BaseTask { |
| 21 |
|
|
|
|
friend class TaskGroup; |
| 22 |
|
|
|
|
friend class TaskExecutor; |
| 23 |
|
|
|
|
public: |
| 24 |
|
|
|
|
explicit BaseTask(const QString& name); |
| 25 |
|
|
|
|
explicit BaseTask(const BaseTask&) = delete; |
| 26 |
|
|
|
|
explicit BaseTask(BaseTask&&) noexcept = delete; |
| 27 |
|
|
|
|
|
| 28 |
|
|
6/6
✓ Call 0 invoked.
✓ Call 1 invoked.
✓ Call 2 invoked.
✓ Call 3 invoked.
✓ Call 4 invoked.
✓ Call 5 invoked.
|
7904 |
virtual ~BaseTask() = default; |
| 29 |
|
|
|
|
|
| 30 |
|
|
|
|
BaseTask& operator=(const BaseTask&) = delete; |
| 31 |
|
|
|
|
BaseTask& operator=(BaseTask&&) noexcept = delete; |
| 32 |
|
|
|
|
|
| 33 |
|
|
|
|
[[nodiscard]] const QString& name() const; |
| 34 |
|
|
|
|
protected: |
| 35 |
|
|
|
|
virtual void wait() = 0; |
| 36 |
|
|
|
|
virtual void run(const std::function<void()>& onSuccess, const std::function<void(const BaseTaskException&)>& onException) = 0; |
| 37 |
|
|
|
|
private: |
| 38 |
|
|
|
|
QString name_; |
| 39 |
|
|
|
|
}; |
| 40 |
|
|
|
|
} |
| 41 |
|
|
|
|
|
| 42 |
|
|
|
|
#endif // CLO3D_BASETASK_H |
| 43 |
|
|
|
|
|