diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-01-19 14:47:58 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-01-19 17:56:48 -0800 |
commit | 9b62661b07e86fc1d64e308fde3e15527c1cd8c8 (patch) | |
tree | c27b37e3f94b53d4fdd5855d1eb68868ce803bae /src/mbgl/map | |
parent | 48cced9e311d5c1cf2a98937eeaf638c94456c8d (diff) | |
download | qtlocation-mapboxgl-9b62661b07e86fc1d64e308fde3e15527c1cd8c8.tar.gz |
[core] Use experimental optional instead of mapbox::util::optional
Diffstat (limited to 'src/mbgl/map')
-rw-r--r-- | src/mbgl/map/geometry_tile.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/map/geometry_tile.hpp | 6 | ||||
-rw-r--r-- | src/mbgl/map/map.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/map/map_context.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/map/map_context.hpp | 5 | ||||
-rw-r--r-- | src/mbgl/map/vector_tile.cpp | 6 | ||||
-rw-r--r-- | src/mbgl/map/vector_tile.hpp | 2 |
7 files changed, 12 insertions, 13 deletions
diff --git a/src/mbgl/map/geometry_tile.cpp b/src/mbgl/map/geometry_tile.cpp index 1bb132f316..82affc689f 100644 --- a/src/mbgl/map/geometry_tile.cpp +++ b/src/mbgl/map/geometry_tile.cpp @@ -4,7 +4,7 @@ namespace mbgl { -mapbox::util::optional<Value> GeometryTileFeatureExtractor::getValue(const std::string& key) const { +optional<Value> GeometryTileFeatureExtractor::getValue(const std::string& key) const { if (key == "$type") { return Value(uint64_t(feature.getType())); } diff --git a/src/mbgl/map/geometry_tile.hpp b/src/mbgl/map/geometry_tile.hpp index 4ae08cc9d8..dd9a21bc62 100644 --- a/src/mbgl/map/geometry_tile.hpp +++ b/src/mbgl/map/geometry_tile.hpp @@ -2,13 +2,13 @@ #define MBGL_MAP_GEOMETRY_TILE #include <mapbox/variant.hpp> -#include <mapbox/optional.hpp> #include <mbgl/style/value.hpp> #include <mbgl/util/chrono.hpp> #include <mbgl/util/ptr.hpp> #include <mbgl/util/vec.hpp> #include <mbgl/util/noncopyable.hpp> +#include <mbgl/util/optional.hpp> #include <cstdint> #include <string> @@ -30,7 +30,7 @@ class GeometryTileFeature : private util::noncopyable { public: virtual ~GeometryTileFeature() = default; virtual FeatureType getType() const = 0; - virtual mapbox::util::optional<Value> getValue(const std::string& key) const = 0; + virtual optional<Value> getValue(const std::string& key) const = 0; virtual GeometryCollection getGeometries() const = 0; }; @@ -73,7 +73,7 @@ public: GeometryTileFeatureExtractor(const GeometryTileFeature& feature_) : feature(feature_) {} - mapbox::util::optional<Value> getValue(const std::string& key) const; + optional<Value> getValue(const std::string& key) const; private: const GeometryTileFeature& feature; diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp index e710ca4c14..51106db88b 100644 --- a/src/mbgl/map/map.cpp +++ b/src/mbgl/map/map.cpp @@ -469,7 +469,7 @@ void Map::addCustomLayer(const std::string& id, const char* before) { context->invoke(&MapContext::addLayer, std::make_unique<CustomLayer>(id, initialize, render, deinitialize, context_), - before ? std::string(before) : mapbox::util::optional<std::string>()); + before ? std::string(before) : optional<std::string>()); } void Map::removeCustomLayer(const std::string& id) { diff --git a/src/mbgl/map/map_context.cpp b/src/mbgl/map/map_context.cpp index eb17e20aea..89c491facd 100644 --- a/src/mbgl/map/map_context.cpp +++ b/src/mbgl/map/map_context.cpp @@ -279,7 +279,7 @@ double MapContext::getTopOffsetPixelsForAnnotationIcon(const std::string& name) return data.getAnnotationManager()->getTopOffsetPixelsForIcon(name); } -void MapContext::addLayer(std::unique_ptr<StyleLayer> layer, mapbox::util::optional<std::string> after) { +void MapContext::addLayer(std::unique_ptr<StyleLayer> layer, optional<std::string> after) { style->addLayer(std::move(layer), after); updateFlags |= Update::Classes; asyncUpdate.send(); diff --git a/src/mbgl/map/map_context.hpp b/src/mbgl/map/map_context.hpp index 012da785c9..dd0c2de465 100644 --- a/src/mbgl/map/map_context.hpp +++ b/src/mbgl/map/map_context.hpp @@ -10,8 +10,7 @@ #include <mbgl/util/async_task.hpp> #include <mbgl/util/gl_object_store.hpp> #include <mbgl/util/ptr.hpp> - -#include <mapbox/optional.hpp> +#include <mbgl/util/optional.hpp> #include <vector> @@ -58,7 +57,7 @@ public: // Style API void addLayer(std::unique_ptr<StyleLayer>, - const mapbox::util::optional<std::string> before); + const optional<std::string> before); void removeLayer(const std::string& id); void setSourceTileCacheSize(size_t size); diff --git a/src/mbgl/map/vector_tile.cpp b/src/mbgl/map/vector_tile.cpp index 343efe4314..8faaae395e 100644 --- a/src/mbgl/map/vector_tile.cpp +++ b/src/mbgl/map/vector_tile.cpp @@ -54,10 +54,10 @@ VectorTileFeature::VectorTileFeature(pbf feature_pbf, const VectorTileLayer& lay } } -mapbox::util::optional<Value> VectorTileFeature::getValue(const std::string& key) const { +optional<Value> VectorTileFeature::getValue(const std::string& key) const { auto keyIter = layer.keys.find(key); if (keyIter == layer.keys.end()) { - return mapbox::util::optional<Value>(); + return optional<Value>(); } pbf tags = tags_pbf; @@ -82,7 +82,7 @@ mapbox::util::optional<Value> VectorTileFeature::getValue(const std::string& key } } - return mapbox::util::optional<Value>(); + return optional<Value>(); } GeometryCollection VectorTileFeature::getGeometries() const { diff --git a/src/mbgl/map/vector_tile.hpp b/src/mbgl/map/vector_tile.hpp index 1b836b84bc..1557db784f 100644 --- a/src/mbgl/map/vector_tile.hpp +++ b/src/mbgl/map/vector_tile.hpp @@ -16,7 +16,7 @@ public: VectorTileFeature(pbf, const VectorTileLayer&); FeatureType getType() const override { return type; } - mapbox::util::optional<Value> getValue(const std::string&) const override; + optional<Value> getValue(const std::string&) const override; GeometryCollection getGeometries() const override; private: |