summaryrefslogtreecommitdiff
path: root/src/mbgl/style/layer_impl.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/style/layer_impl.hpp')
-rw-r--r--src/mbgl/style/layer_impl.hpp21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/mbgl/style/layer_impl.hpp b/src/mbgl/style/layer_impl.hpp
index 914203f804..fe7259a11a 100644
--- a/src/mbgl/style/layer_impl.hpp
+++ b/src/mbgl/style/layer_impl.hpp
@@ -3,13 +3,10 @@
#include <mbgl/style/layer.hpp>
#include <mbgl/style/types.hpp>
#include <mbgl/style/filter.hpp>
-#include <mbgl/style/layer_observer.hpp>
-#include <mbgl/util/noncopyable.hpp>
#include <rapidjson/writer.h>
#include <rapidjson/stringbuffer.h>
-#include <memory>
#include <string>
#include <limits>
@@ -30,24 +27,19 @@ namespace style {
* Members that are public in `FooLayer::Impl` are part of the internal API for "foo" layers.
* Members that are private in `FooLayer::Impl` are internal to "foo" layers.
*/
-class Layer::Impl {
+class Layer::Impl : public EnableImmutableFromThis<Layer::Impl> {
public:
+ Impl(LayerType, std::string layerID, std::string sourceID);
virtual ~Impl() = default;
- // Create an identical copy of this layer.
- virtual std::unique_ptr<Layer> clone() const = 0;
-
- // Create a layer, copying all properties except id and paint properties from this layer.
- virtual std::unique_ptr<Layer> cloneRef(const std::string& id) const = 0;
+ Impl& operator=(const Impl&) = delete;
// Utility function for automatic layer grouping.
virtual void stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>&) const = 0;
virtual std::unique_ptr<RenderLayer> createRenderLayer() const = 0;
- void setObserver(LayerObserver*);
-
-public:
+ const LayerType type;
std::string id;
std::string source;
std::string sourceLayer;
@@ -56,13 +48,8 @@ public:
float maxZoom = std::numeric_limits<float>::infinity();
VisibilityType visibility = VisibilityType::Visible;
- LayerObserver nullObserver;
- LayerObserver* observer = &nullObserver;
-
protected:
- Impl() = default;
Impl(const Impl&) = default;
- Impl& operator=(const Impl&) = delete;
};
} // namespace style