summaryrefslogtreecommitdiff
path: root/include/mbgl/util/timer.hpp
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <thiago@mapbox.com>2015-11-29 00:27:34 +0200
committerThiago Marcos P. Santos <thiago@mapbox.com>2016-03-21 23:58:48 -0300
commitbaf30cd1f776ec0a44688c12580bacf45e33c93c (patch)
tree26bd25735140f3556762a967e0f60897eecf4a4e /include/mbgl/util/timer.hpp
parentc50194ebfabd90225a65b1e85323827541a3079b (diff)
downloadqtlocation-mapboxgl-baf30cd1f776ec0a44688c12580bacf45e33c93c.tar.gz
[glfw] Main loop integration
This new code can be used for rendering on the Main thread while it will also work for rendering on the Map thread before we make the switch. Needed by #2909.
Diffstat (limited to 'include/mbgl/util/timer.hpp')
-rw-r--r--include/mbgl/util/timer.hpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/mbgl/util/timer.hpp b/include/mbgl/util/timer.hpp
new file mode 100644
index 0000000000..783241847d
--- /dev/null
+++ b/include/mbgl/util/timer.hpp
@@ -0,0 +1,29 @@
+#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();
+
+private:
+ class Impl;
+ std::unique_ptr<Impl> impl;
+};
+
+} // namespace util
+} // namespace mbgl
+
+#endif