From 6232d13f5321b87ddf12a1aa36b4545da45f173d Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Wed, 17 Nov 2021 22:34:57 +0100 Subject: Travel3: Simple image and video display site Reads the images and videos from filesystem and builds a site in memroy. --- src/task_runner.hh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/task_runner.hh (limited to 'src/task_runner.hh') 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 +#include + +class Looper; + +class TaskRunner { +public: + virtual ~TaskRunner() = default; + + static std::unique_ptr create(std::shared_ptr looper); + static std::unique_ptr create(size_t threads = 1); + + virtual void post(std::function callback) = 0; + +protected: + TaskRunner() = default; + TaskRunner(TaskRunner const&) = delete; + TaskRunner& operator=(TaskRunner const&) = delete; +}; + +#endif // TASK_RUNNER_HH -- cgit v1.2.3-70-g09d2