wavelength 1.0.0
Loading...
Searching...
No Matches
tasklist.h
Go to the documentation of this file.
1#pragma once
2
3#include <list>
4#include <memory>
5
6#include "os/task.h"
7
13class TaskList {
14public:
22
30 void Add(Task *pTask);
31
38 void Poll();
39
41 const std::list<std::unique_ptr<Task>> &GetTasks() const {
42 return mTasks;
43 }
44
45private:
46 std::list<std::unique_ptr<Task>> mTasks;
47};
Tasks that run side by side until each one ends.
Definition tasklist.h:13
void Poll()
Poll every task, and stop and delete each one that is no longer running.
~TaskList()
Stop and delete every task.
const std::list< std::unique_ptr< Task > > & GetTasks() const
Definition tasklist.h:41
void Add(Task *pTask)
Append a task and start it.
Unit of work an owner starts, polls until it reports that it is done, and stops.
Definition task.h:9