diff options
| author | Joel Klinghed <the_jk@spawned.biz> | 2021-11-17 22:34:57 +0100 |
|---|---|---|
| committer | Joel Klinghed <the_jk@spawned.biz> | 2021-11-17 22:34:57 +0100 |
| commit | 6232d13f5321b87ddf12a1aa36b4545da45f173d (patch) | |
| tree | 23f3316470a14136debd9d02f9e920ca2b06f4cc /src/task_runner.hh | |
Travel3: Simple image and video display site
Reads the images and videos from filesystem and builds a site in
memroy.
Diffstat (limited to 'src/task_runner.hh')
| -rw-r--r-- | src/task_runner.hh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/task_runner.hh b/src/task_runner.hh new file mode 100644 index 0000000..d1c79d6 --- /dev/null +++ b/src/task_runner.hh @@ -0,0 +1,24 @@ +#ifndef TASK_RUNNER_HH +#define TASK_RUNNER_HH + +#include <functional> +#include <memory> + +class Looper; + +class TaskRunner { +public: + virtual ~TaskRunner() = default; + + static std::unique_ptr<TaskRunner> create(std::shared_ptr<Looper> looper); + static std::unique_ptr<TaskRunner> create(size_t threads = 1); + + virtual void post(std::function<void()> callback) = 0; + +protected: + TaskRunner() = default; + TaskRunner(TaskRunner const&) = delete; + TaskRunner& operator=(TaskRunner const&) = delete; +}; + +#endif // TASK_RUNNER_HH |
