From 80290e7d65dc498e9ea5e64aa6cbc65282072deb Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 18 Jun 2021 07:27:57 +0200 Subject: New dependency system. --- task.h | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'task.h') diff --git a/task.h b/task.h index 443b6b7..2dd05e3 100644 --- a/task.h +++ b/task.h @@ -3,13 +3,30 @@ #include #include +#include +#include +#include class Task { public: - virtual bool dirty() = 0; - virtual int run() = 0; + Task(const std::vector& depends); + + void registerDepTasks(const std::list>& tasks); + + bool dirty(); + bool ready(); + int run(); + bool done() const; virtual int clean() = 0 ; virtual std::vector depends() const = 0; virtual std::string target() const = 0; + +protected: + std::atomic is_done{false}; + virtual int runInner() { return 0; }; + virtual bool dirtyInner() { return false; } + + std::vector dependsStr; + std::list> dependsTasks; }; -- cgit v1.2.3