summaryrefslogtreecommitdiff
path: root/include/mbgl/util/work_task.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/mbgl/util/work_task.hpp')
-rw-r--r--include/mbgl/util/work_task.hpp8
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