summaryrefslogtreecommitdiff
path: root/include/mbgl/style/layer.hpp
diff options
context:
space:
mode:
authorIvo van Dongen <info@ivovandongen.nl>2017-04-21 09:19:47 -0700
committerIvo van Dongen <ivovandongen@users.noreply.github.com>2017-04-25 17:23:54 -0700
commit3c175adf30546fe58713b8fed29ac35a85e150be (patch)
tree5666e9bcf311ed1b86a13444e50dc7a030c10da9 /include/mbgl/style/layer.hpp
parentea8ec38df156c6683c886253dbb1f6bc828686ff (diff)
downloadqtlocation-mapboxgl-3c175adf30546fe58713b8fed29ac35a85e150be.tar.gz
[core] split off render layers
Diffstat (limited to 'include/mbgl/style/layer.hpp')
-rw-r--r--include/mbgl/style/layer.hpp38
1 files changed, 15 insertions, 23 deletions
diff --git a/include/mbgl/style/layer.hpp b/include/mbgl/style/layer.hpp
index fa88b30dbc..f09eb0165a 100644
--- a/include/mbgl/style/layer.hpp
+++ b/include/mbgl/style/layer.hpp
@@ -2,6 +2,7 @@
#include <mbgl/util/noncopyable.hpp>
#include <mbgl/util/any.hpp>
+#include <mbgl/style/layer_type.hpp>
#include <mbgl/style/types.hpp>
#include <memory>
@@ -36,23 +37,16 @@ class FillExtrusionLayer;
* auto circleLayer = std::make_unique<CircleLayer>("my-circle-layer");
*/
class Layer : public mbgl::util::noncopyable {
+public:
+ class Impl;
+
protected:
- enum class Type {
- Fill,
- Line,
- Circle,
- Symbol,
- Raster,
- Background,
- Custom,
- FillExtrusion,
- };
- class Impl;
- const Type type;
- Layer(Type, std::unique_ptr<Impl>);
+ const LayerType type;
+ Layer(LayerType, std::unique_ptr<Impl>);
public:
+
virtual ~Layer();
// Check whether this layer is of the given subtype.
@@ -85,21 +79,21 @@ public:
template <class V>
auto accept(V&& visitor) {
switch (type) {
- case Type::Fill:
+ case LayerType::Fill:
return visitor(*as<FillLayer>());
- case Type::Line:
+ case LayerType::Line:
return visitor(*as<LineLayer>());
- case Type::Circle:
+ case LayerType::Circle:
return visitor(*as<CircleLayer>());
- case Type::Symbol:
+ case LayerType::Symbol:
return visitor(*as<SymbolLayer>());
- case Type::Raster:
+ case LayerType::Raster:
return visitor(*as<RasterLayer>());
- case Type::Background:
+ case LayerType::Background:
return visitor(*as<BackgroundLayer>());
- case Type::Custom:
+ case LayerType::Custom:
return visitor(*as<CustomLayer>());
- case Type::FillExtrusion:
+ case LayerType::FillExtrusion:
return visitor(*as<FillExtrusionLayer>());
}
}
@@ -123,8 +117,6 @@ public:
// object here, so that separately-obtained references to this object share
// identical platform-native peers.
any peer;
-
- friend std::string layoutKey(const Layer&);
};
} // namespace style