summaryrefslogtreecommitdiff
path: root/task.h
diff options
context:
space:
mode:
Diffstat (limited to 'task.h')
-rw-r--r--task.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/task.h b/task.h
index 2dd05e3..00b01d2 100644
--- a/task.h
+++ b/task.h
@@ -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; }