diff options
Diffstat (limited to 'task.h')
-rw-r--r-- | task.h | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -7,6 +7,15 @@ #include <list> #include <memory> +enum class State +{ + Unknown, + Ready, + Running, + Done, + Error, +}; + class Task { public: @@ -17,13 +26,13 @@ public: bool dirty(); bool ready(); int run(); - bool done() const; + State state() const; virtual int clean() = 0 ; virtual std::vector<std::string> depends() const = 0; virtual std::string target() const = 0; protected: - std::atomic<bool> is_done{false}; + std::atomic<State> task_state{State::Unknown}; virtual int runInner() { return 0; }; virtual bool dirtyInner() { return false; } |