1#pragma once
2
3#include <mbgl/util/noncopyable.hpp>
4
5#include <memory>
6
7namespace mbgl {
8
9// A movable type-erasing function wrapper. This allows to store arbitrary invokable
10// things (like std::function<>, or the result of a movable-only std::bind()) in the queue.
11// Source: http://stackoverflow.com/a/29642072/331379
12class WorkTask : private util::noncopyable {
13public:
14 virtual ~WorkTask() = default;
15
16 virtual void operator()() = 0;
17 virtual void cancel() = 0;
18
19 template <class Fn, class... Args>
20 static std::shared_ptr<WorkTask> make(Fn&&, Args&&...);
21};
22
23} // namespace mbgl
24

source code of qtlocation/src/3rdparty/mapbox-gl-native/include/mbgl/util/work_task.hpp