2013-12-20 19:17:26 +05:30
|
|
|
#pragma once
|
|
|
|
|
2022-06-12 22:00:09 +05:30
|
|
|
#include "ConcurrentTask.h"
|
|
|
|
|
|
|
|
/** A concurrent task that only allows one concurrent task :)
|
|
|
|
*
|
|
|
|
* This should be used when there's a need to maintain a strict ordering of task executions, and
|
|
|
|
* the starting of a task is contingent on the success of the previous one.
|
|
|
|
*
|
|
|
|
* See MultipleOptionsTask if that's not the case.
|
|
|
|
*/
|
|
|
|
class SequentialTask : public ConcurrentTask {
|
2018-07-15 18:21:05 +05:30
|
|
|
Q_OBJECT
|
2022-06-12 22:00:09 +05:30
|
|
|
public:
|
|
|
|
explicit SequentialTask(QObject* parent = nullptr, QString task_name = "");
|
|
|
|
~SequentialTask() override = default;
|
2022-05-09 19:23:52 +05:30
|
|
|
|
2022-06-12 22:00:09 +05:30
|
|
|
protected:
|
|
|
|
void startNext() override;
|
|
|
|
void updateState() override;
|
2013-12-20 19:17:26 +05:30
|
|
|
};
|