TouchCPLib  1.0.0
A touch-enabled GUI interface based on SDL and libTS. It provides a simple desktop-free UI for your embedded Raspberry projects.
Task.h
Go to the documentation of this file.
1 #pragma once
2 
13 #include <functional>
14 
18 class Task
19 {
20 public:
21  Task(std::function<void(void)> runner) : runner(runner){};
22  // Unneeded overhead since the std::function alone is enough, but we keep it like this for now
23  void operator()()
24  {
25  runner();
26  }
27 
28 private:
29  std::function<void(void)> runner;
30 };
Task(std::function< void(void)> runner)
Definition: Task.h:21
A task is an object that wraps the code to run on an thread.
Definition: Task.h:18
void operator()()
Definition: Task.h:23