1
0
mirror of https://github.com/Zygo/bees.git synced 2025-05-17 21:35:45 +02:00

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 <bees@furryterror.org>
This commit is contained in:
Zygo Blaxell 2018-01-28 22:07:45 -05:00
parent 2aacdcd95f
commit 92fda34a68

View File

@ -18,10 +18,11 @@ namespace crucible {
Task(shared_ptr<TaskState> pts);
TaskId id() const;
public:
// create empty Task object
Task() = default;
// create Task object containing closure and description
Task(string title, function<void()> 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);