summaryrefslogtreecommitdiff
path: root/src/mbgl/tile/geometry_tile_data.hpp
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-05-20 16:12:22 +0200
committerKonstantin Käfer <mail@kkaefer.com>2016-06-10 12:42:14 +0200
commit2b6d0751cf3495c9246af27fdff6f565186bb2f8 (patch)
tree8c21aea06e2bd19c37b01156ea882038069b85dc /src/mbgl/tile/geometry_tile_data.hpp
parent6b729ccb4680e41fd6346aeb5a5e55027ca49052 (diff)
downloadqtlocation-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.hpp20
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