diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2014-12-04 15:46:28 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2014-12-04 15:58:04 -0800 |
commit | 0a942b6f143373c30fdd2027ff75fdb3b0c71551 (patch) | |
tree | 4cc10fdf2103eb0789bf82f7f4002c21c3c19f44 /include/mbgl | |
parent | 13564fb876f6e473d961b5e4a6a89f58d986d2e3 (diff) | |
download | qtlocation-mapboxgl-0a942b6f143373c30fdd2027ff75fdb3b0c71551.tar.gz |
Change Map::stop to use std::function<void()>
Fixes #685
Diffstat (limited to 'include/mbgl')
-rw-r--r-- | include/mbgl/map/map.hpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index 08f4ca5647..23bd211af9 100644 --- a/include/mbgl/map/map.hpp +++ b/include/mbgl/map/map.hpp @@ -13,6 +13,7 @@ #include <iosfwd> #include <set> #include <vector> +#include <functional> namespace mbgl { @@ -31,8 +32,6 @@ class GlyphAtlas; class SpriteAtlas; class Map : private util::noncopyable { - typedef void (*stop_callback)(void *); - public: explicit Map(View&, FileSource&); ~Map(); @@ -43,9 +42,8 @@ public: // Stop the map render thread. This call will block until the map rendering thread stopped. // The optional callback function will be invoked repeatedly until the map thread is stopped. // The callback function should wait until it is woken up again by view.notify(), otherwise - // this will be a busy waiting loop. The optional data parameter will be passed to the callback - // function. - void stop(stop_callback cb = nullptr, void *data = nullptr); + // this will be a busy waiting loop. + void stop(std::function<void ()> callback = std::function<void ()>()); // Runs the map event loop. ONLY run this function when you want to get render a single frame // with this map object. It will *not* spawn a separate thread and instead block until the |