summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <thiago@mapbox.com>2015-08-31 10:41:52 +0300
committerThiago Marcos P. Santos <thiago@mapbox.com>2015-12-01 00:00:09 +0200
commit123c5df92219bde3dda39d3ba942b996e765e8e9 (patch)
tree2d2087794966201dc79d15f7acd62c45dfa181c8 /src
parent704ab891a77e352226872fd54d0ceea947a45579 (diff)
downloadqtlocation-mapboxgl-123c5df92219bde3dda39d3ba942b996e765e8e9.tar.gz
[core] Introduce the AsyncTask
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/util/async_task.hpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/mbgl/util/async_task.hpp b/src/mbgl/util/async_task.hpp
new file mode 100644
index 0000000000..09bdab94d7
--- /dev/null
+++ b/src/mbgl/util/async_task.hpp
@@ -0,0 +1,28 @@
+#ifndef MBGL_UTIL_ASYNC_TASK
+#define MBGL_UTIL_ASYNC_TASK
+
+#include <mbgl/util/noncopyable.hpp>
+
+#include <memory>
+#include <functional>
+
+namespace mbgl {
+namespace util {
+
+class AsyncTask : private util::noncopyable {
+public:
+ AsyncTask(std::function<void()>&&);
+ ~AsyncTask();
+
+ void send();
+ void unref();
+
+private:
+ class Impl;
+ std::unique_ptr<Impl> impl;
+};
+
+}
+}
+
+#endif