summaryrefslogtreecommitdiff
path: root/include/mbgl/util/timer.hpp
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <thiago@mapbox.com>2015-10-27 14:27:16 +0200
committerThiago Marcos P. Santos <thiago@mapbox.com>2015-12-01 00:00:09 +0200
commit9b36c19aeb4f05e11a496d67e7388a4df0820361 (patch)
tree4167b4cd77f70d267301930be625d63d910bc3f8 /include/mbgl/util/timer.hpp
parent0d8ea6c0a238a3b76d4ac49dee89f8e62769b8fe (diff)
downloadqtlocation-mapboxgl-9b36c19aeb4f05e11a496d67e7388a4df0820361.tar.gz
[core] Introduce Timer abstraction
Diffstat (limited to 'include/mbgl/util/timer.hpp')
-rw-r--r--include/mbgl/util/timer.hpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/include/mbgl/util/timer.hpp b/include/mbgl/util/timer.hpp
new file mode 100644
index 0000000000..932bb47950
--- /dev/null
+++ b/include/mbgl/util/timer.hpp
@@ -0,0 +1,30 @@
+#ifndef MBGL_UTIL_TIMER
+#define MBGL_UTIL_TIMER
+
+#include <mbgl/util/noncopyable.hpp>
+#include <mbgl/util/chrono.hpp>
+
+#include <memory>
+#include <functional>
+
+namespace mbgl {
+namespace util {
+
+class Timer : private util::noncopyable {
+public:
+ Timer();
+ ~Timer();
+
+ void start(Duration timeout, Duration repeat, std::function<void()>&&);
+ void stop();
+ void unref();
+
+private:
+ class Impl;
+ std::unique_ptr<Impl> impl;
+};
+
+}
+}
+
+#endif