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:
parent
2aacdcd95f
commit
92fda34a68
@ -18,10 +18,11 @@ namespace crucible {
|
|||||||
|
|
||||||
Task(shared_ptr<TaskState> pts);
|
Task(shared_ptr<TaskState> pts);
|
||||||
|
|
||||||
TaskId id() const;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// create empty Task object
|
||||||
|
Task() = default;
|
||||||
|
|
||||||
// create Task object containing closure and description
|
// create Task object containing closure and description
|
||||||
Task(string title, function<void()> exec_fn);
|
Task(string title, function<void()> exec_fn);
|
||||||
|
|
||||||
@ -45,6 +46,9 @@ namespace crucible {
|
|||||||
|
|
||||||
// Null test
|
// Null test
|
||||||
operator bool() const;
|
operator bool() const;
|
||||||
|
|
||||||
|
// Unique non-repeating(ish) ID for task
|
||||||
|
TaskId id() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
ostream &operator<<(ostream &os, const Task &task);
|
ostream &operator<<(ostream &os, const Task &task);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user