blob: a874625c81411fbb1480976db940b5ee004682f6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#ifndef MBGL_UTIL_WORK_TASK
#define MBGL_UTIL_WORK_TASK
#include <mbgl/util/noncopyable.hpp>
namespace mbgl {
// A movable type-erasing function wrapper. This allows to store arbitrary invokable
// things (like std::function<>, or the result of a movable-only std::bind()) in the queue.
// Source: http://stackoverflow.com/a/29642072/331379
class WorkTask : private util::noncopyable {
public:
virtual ~WorkTask() = default;
virtual void operator()() = 0;
virtual void cancel() = 0;
};
} // namespace mbgl
#endif
|