diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2016-05-20 16:12:22 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2016-06-10 12:42:14 +0200 |
commit | 2b6d0751cf3495c9246af27fdff6f565186bb2f8 (patch) | |
tree | 8c21aea06e2bd19c37b01156ea882038069b85dc /src/mbgl/tile/geometry_tile_data.hpp | |
parent | 6b729ccb4680e41fd6346aeb5a5e55027ca49052 (diff) | |
download | qtlocation-mapboxgl-2b6d0751cf3495c9246af27fdff6f565186bb2f8.tar.gz |
[core] restructure TileSource construction and callbacks
Diffstat (limited to 'src/mbgl/tile/geometry_tile_data.hpp')
-rw-r--r-- | src/mbgl/tile/geometry_tile_data.hpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/mbgl/tile/geometry_tile_data.hpp b/src/mbgl/tile/geometry_tile_data.hpp index 00d919a8a6..8a16a32958 100644 --- a/src/mbgl/tile/geometry_tile_data.hpp +++ b/src/mbgl/tile/geometry_tile_data.hpp @@ -12,6 +12,7 @@ namespace mbgl { class AsyncRequest; +class GeometryTile; class GeometryTileSource; class FeatureIndex; @@ -22,17 +23,21 @@ class Style; class GeometryTileData : public TileData { public: GeometryTileData(const OverscaledTileID&, - std::unique_ptr<GeometryTileSource> tileSource, - std::string sourceID, - style::Style&, - const MapMode, - const std::function<void(std::exception_ptr)>& callback); + std::string sourceID, + style::Style&, + const MapMode, + const std::function<void(std::exception_ptr)>& callback); ~GeometryTileData(); + void setData(std::exception_ptr err, + std::unique_ptr<GeometryTile> tile, + optional<Timestamp> modified_, + optional<Timestamp> expires_); + Bucket* getBucket(const style::Layer&) override; - bool parsePending(std::function<void(std::exception_ptr)> callback) override; + bool parsePending() override; void redoPlacement(PlacementConfig config, const std::function<void()>&) override; void redoPlacement(const std::function<void()>&) override; @@ -50,7 +55,6 @@ private: Worker& worker; TileWorker tileWorker; - std::unique_ptr<AsyncRequest> tileRequest; std::unique_ptr<AsyncRequest> workRequest; // Contains all the Bucket objects for the tile. Buckets are render @@ -69,6 +73,8 @@ private: // Used to signal the worker that it should abandon parsing this tile as soon as possible. util::Atomic<bool> obsolete { false }; + + const std::function<void(std::exception_ptr)> callback; }; } // namespace mbgl |