mirror of
				https://github.com/Zygo/bees.git
				synced 2025-11-04 04:00:36 +01: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:
		@@ -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);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user