2013-12-20 13:47:26 +00:00
|
|
|
#pragma once
|
|
|
|
|
2022-06-12 17:30:09 +01:00
|
|
|
#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 13:51:05 +01:00
|
|
|
Q_OBJECT
|
2022-06-12 17:30:09 +01:00
|
|
|
public:
|
|
|
|
explicit SequentialTask(QObject* parent = nullptr, QString task_name = "");
|
|
|
|
~SequentialTask() override = default;
|
2022-05-09 14:53:52 +01:00
|
|
|
|
2022-06-12 17:30:09 +01:00
|
|
|
protected:
|
|
|
|
void startNext() override;
|
|
|
|
void updateState() override;
|
2013-12-20 13:47:26 +00:00
|
|
|
};
|