diff options
author | Thiago Marcos P. Santos <thiago@mapbox.com> | 2015-10-27 14:27:16 +0200 |
---|---|---|
committer | Thiago Marcos P. Santos <thiago@mapbox.com> | 2015-12-01 00:00:09 +0200 |
commit | 9b36c19aeb4f05e11a496d67e7388a4df0820361 (patch) | |
tree | 4167b4cd77f70d267301930be625d63d910bc3f8 /include/mbgl/util | |
parent | 0d8ea6c0a238a3b76d4ac49dee89f8e62769b8fe (diff) | |
download | qtlocation-mapboxgl-9b36c19aeb4f05e11a496d67e7388a4df0820361.tar.gz |
[core] Introduce Timer abstraction
Diffstat (limited to 'include/mbgl/util')
-rw-r--r-- | include/mbgl/util/timer.hpp | 30 |
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 |