diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-09-02 16:52:25 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-09-08 16:36:47 -0700 |
commit | e4995e8d3a38dfd2ed64337e712ecf701af37454 (patch) | |
tree | 234490c1f4e93afb99738d6790be46ea1fe9c1c8 /include/mbgl/util/work_task.hpp | |
parent | a85f7540c7f4ac289abba1dc3aa71058bc820b05 (diff) | |
download | qtlocation-mapboxgl-e4995e8d3a38dfd2ed64337e712ecf701af37454.tar.gz |
[core] Extract WorkTaskImpl from run_loop.hpp
Diffstat (limited to 'include/mbgl/util/work_task.hpp')
-rw-r--r-- | include/mbgl/util/work_task.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/mbgl/util/work_task.hpp b/include/mbgl/util/work_task.hpp index 43f4810b43..e9c2062d9c 100644 --- a/include/mbgl/util/work_task.hpp +++ b/include/mbgl/util/work_task.hpp @@ -2,6 +2,8 @@ #include <mbgl/util/noncopyable.hpp> +#include <memory> + namespace mbgl { // A movable type-erasing function wrapper. This allows to store arbitrary invokable @@ -13,6 +15,12 @@ public: virtual void operator()() = 0; virtual void cancel() = 0; + + template <class Fn, class... Args> + static std::shared_ptr<WorkTask> make(Fn&& fn, Args&&... args); + + template <class Fn, class Cb, class... Args> + static std::shared_ptr<WorkTask> makeWithCallback(Fn&& fn, Cb&& callback, Args&&... args); }; } // namespace mbgl |