summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-08-25 13:57:53 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-08-26 10:30:55 -0700
commit7c801696ebd3f70d055d0a60f1917177bfd2d09b (patch)
tree3097ce17859697082568f22f2b803463fb37a492
parenta79d2afe1b43d9fa42e00629c4e07d9463d30d91 (diff)
downloadqtlocation-mapboxgl-7c801696ebd3f70d055d0a60f1917177bfd2d09b.tar.gz
[core] const consistency
-rw-r--r--src/mbgl/annotation/annotation_tile.cpp2
-rw-r--r--src/mbgl/annotation/annotation_tile.hpp2
-rw-r--r--src/mbgl/tile/geojson_tile.cpp4
-rw-r--r--src/mbgl/tile/geometry_tile.cpp2
-rw-r--r--src/mbgl/tile/geometry_tile.hpp2
-rw-r--r--src/mbgl/tile/geometry_tile_data.hpp2
-rw-r--r--src/mbgl/tile/vector_tile.cpp4
-rw-r--r--src/mbgl/util/worker.cpp4
-rw-r--r--src/mbgl/util/worker.hpp2
9 files changed, 12 insertions, 12 deletions
diff --git a/src/mbgl/annotation/annotation_tile.cpp b/src/mbgl/annotation/annotation_tile.cpp
index 06ae82adb3..2c676420dd 100644
--- a/src/mbgl/annotation/annotation_tile.cpp
+++ b/src/mbgl/annotation/annotation_tile.cpp
@@ -40,7 +40,7 @@ optional<Value> AnnotationTileFeature::getValue(const std::string& key) const {
AnnotationTileLayer::AnnotationTileLayer(std::string name_)
: name(std::move(name_)) {}
-util::ptr<GeometryTileLayer> AnnotationTileData::getLayer(const std::string& name) const {
+util::ptr<const GeometryTileLayer> AnnotationTileData::getLayer(const std::string& name) const {
auto it = layers.find(name);
if (it != layers.end()) {
return it->second;
diff --git a/src/mbgl/annotation/annotation_tile.hpp b/src/mbgl/annotation/annotation_tile.hpp
index 4e0b1551d7..78ed9e4080 100644
--- a/src/mbgl/annotation/annotation_tile.hpp
+++ b/src/mbgl/annotation/annotation_tile.hpp
@@ -56,7 +56,7 @@ private:
class AnnotationTileData : public GeometryTileData {
public:
- util::ptr<GeometryTileLayer> getLayer(const std::string&) const override;
+ util::ptr<const GeometryTileLayer> getLayer(const std::string&) const override;
std::unordered_map<std::string, util::ptr<AnnotationTileLayer>> layers;
};
diff --git a/src/mbgl/tile/geojson_tile.cpp b/src/mbgl/tile/geojson_tile.cpp
index ab596bd9ba..09c12dff8f 100644
--- a/src/mbgl/tile/geojson_tile.cpp
+++ b/src/mbgl/tile/geojson_tile.cpp
@@ -40,7 +40,7 @@ private:
class GeoJSONTileData : public GeometryTileData {
public:
GeoJSONTileData(std::shared_ptr<GeoJSONTileLayer>);
- util::ptr<GeometryTileLayer> getLayer(const std::string&) const override;
+ util::ptr<const GeometryTileLayer> getLayer(const std::string&) const override;
private:
const std::shared_ptr<GeoJSONTileLayer> layer;
@@ -136,7 +136,7 @@ util::ptr<const GeometryTileFeature> GeoJSONTileLayer::getFeature(std::size_t i)
GeoJSONTileData::GeoJSONTileData(std::shared_ptr<GeoJSONTileLayer> layer_) : layer(std::move(layer_)) {
}
-util::ptr<GeometryTileLayer> GeoJSONTileData::getLayer(const std::string&) const {
+util::ptr<const GeometryTileLayer> GeoJSONTileData::getLayer(const std::string&) const {
// We're ignoring the layer name because GeoJSON tiles only have one layer.
return layer;
}
diff --git a/src/mbgl/tile/geometry_tile.cpp b/src/mbgl/tile/geometry_tile.cpp
index daa358420b..e4e2085d05 100644
--- a/src/mbgl/tile/geometry_tile.cpp
+++ b/src/mbgl/tile/geometry_tile.cpp
@@ -60,7 +60,7 @@ std::vector<std::unique_ptr<Layer>> GeometryTile::cloneStyleLayers() const {
return result;
}
-void GeometryTile::setData(std::unique_ptr<GeometryTileData> data_) {
+void GeometryTile::setData(std::unique_ptr<const GeometryTileData> data_) {
if (!data_) {
// This is a 404 response. We're treating these as empty tiles.
workRequest.reset();
diff --git a/src/mbgl/tile/geometry_tile.hpp b/src/mbgl/tile/geometry_tile.hpp
index 891aba0432..adbe81e29f 100644
--- a/src/mbgl/tile/geometry_tile.hpp
+++ b/src/mbgl/tile/geometry_tile.hpp
@@ -31,7 +31,7 @@ public:
~GeometryTile() override;
void setError(std::exception_ptr err);
- void setData(std::unique_ptr<GeometryTileData>);
+ void setData(std::unique_ptr<const GeometryTileData>);
Bucket* getBucket(const style::Layer&) override;
diff --git a/src/mbgl/tile/geometry_tile_data.hpp b/src/mbgl/tile/geometry_tile_data.hpp
index 4055a80ecf..dcc8e66fcb 100644
--- a/src/mbgl/tile/geometry_tile_data.hpp
+++ b/src/mbgl/tile/geometry_tile_data.hpp
@@ -58,7 +58,7 @@ public:
class GeometryTileData : private util::noncopyable {
public:
virtual ~GeometryTileData() = default;
- virtual util::ptr<GeometryTileLayer> getLayer(const std::string&) const = 0;
+ virtual util::ptr<const GeometryTileLayer> getLayer(const std::string&) const = 0;
};
// classifies an array of rings into polygons with outer rings and holes
diff --git a/src/mbgl/tile/vector_tile.cpp b/src/mbgl/tile/vector_tile.cpp
index 1ba30d8695..e96080ce8c 100644
--- a/src/mbgl/tile/vector_tile.cpp
+++ b/src/mbgl/tile/vector_tile.cpp
@@ -59,7 +59,7 @@ class VectorTileData : public GeometryTileData {
public:
VectorTileData(std::shared_ptr<const std::string> data);
- util::ptr<GeometryTileLayer> getLayer(const std::string&) const override;
+ util::ptr<const GeometryTileLayer> getLayer(const std::string&) const override;
private:
std::shared_ptr<const std::string> data;
@@ -242,7 +242,7 @@ VectorTileData::VectorTileData(std::shared_ptr<const std::string> data_)
: data(std::move(data_)) {
}
-util::ptr<GeometryTileLayer> VectorTileData::getLayer(const std::string& name) const {
+util::ptr<const GeometryTileLayer> VectorTileData::getLayer(const std::string& name) const {
if (!parsed) {
parsed = true;
protozero::pbf_reader tile_pbf(*data);
diff --git a/src/mbgl/util/worker.cpp b/src/mbgl/util/worker.cpp
index 50ecb93c02..39e3b1cea6 100644
--- a/src/mbgl/util/worker.cpp
+++ b/src/mbgl/util/worker.cpp
@@ -31,7 +31,7 @@ public:
void parseGeometryTile(TileWorker* worker,
std::vector<std::unique_ptr<style::Layer>> layers,
- std::unique_ptr<GeometryTileData> tileData,
+ std::unique_ptr<const GeometryTileData> tileData,
PlacementConfig config,
std::function<void(TileParseResult)> callback) {
try {
@@ -80,7 +80,7 @@ Worker::parseRasterTile(std::unique_ptr<RasterBucket> bucket,
std::unique_ptr<AsyncRequest>
Worker::parseGeometryTile(TileWorker& worker,
std::vector<std::unique_ptr<style::Layer>> layers,
- std::unique_ptr<GeometryTileData> tileData,
+ std::unique_ptr<const GeometryTileData> tileData,
PlacementConfig config,
std::function<void(TileParseResult)> callback) {
current = (current + 1) % threads.size();
diff --git a/src/mbgl/util/worker.hpp b/src/mbgl/util/worker.hpp
index 5ab86d1b9e..3c6d3f64b0 100644
--- a/src/mbgl/util/worker.hpp
+++ b/src/mbgl/util/worker.hpp
@@ -41,7 +41,7 @@ public:
Request parseGeometryTile(TileWorker&,
std::vector<std::unique_ptr<style::Layer>>,
- std::unique_ptr<GeometryTileData>,
+ std::unique_ptr<const GeometryTileData>,
PlacementConfig,
std::function<void(TileParseResult)> callback);