From 92fda34a686d1bd5484f98649ca040c01425f011 Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Sun, 28 Jan 2018 22:07:45 -0500 Subject: [PATCH] task: allow user access to ID and default constructor The default constructor makes it more convenient to use Task as a class member. The ID is useful to disambiguate Task references. Signed-off-by: Zygo Blaxell --- include/crucible/task.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/crucible/task.h b/include/crucible/task.h index ef12803..9bb8f26 100644 --- a/include/crucible/task.h +++ b/include/crucible/task.h @@ -18,10 +18,11 @@ namespace crucible { Task(shared_ptr pts); - TaskId id() const; - public: + // create empty Task object + Task() = default; + // create Task object containing closure and description Task(string title, function exec_fn); @@ -45,6 +46,9 @@ namespace crucible { // Null test operator bool() const; + + // Unique non-repeating(ish) ID for task + TaskId id() const; }; ostream &operator<<(ostream &os, const Task &task);