diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-04-25 18:20:26 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-05-12 11:26:27 -0700 |
commit | c2a5894f2dbe9982830066ab9347b059e6e7d845 (patch) | |
tree | c09363c2025b80265de195969ee56cc64e567e70 /src/mbgl/style/layers/symbol_layer.cpp | |
parent | d3f23b83d42de8ef23ea1dbd8abfc6276009531f (diff) | |
download | qtlocation-mapboxgl-c2a5894f2dbe9982830066ab9347b059e6e7d845.tar.gz |
[core] Immutable Impls
Diffstat (limited to 'src/mbgl/style/layers/symbol_layer.cpp')
-rw-r--r-- | src/mbgl/style/layers/symbol_layer.cpp | 558 |
1 files changed, 356 insertions, 202 deletions
diff --git a/src/mbgl/style/layers/symbol_layer.cpp b/src/mbgl/style/layers/symbol_layer.cpp index 273a9fd24e..5a062997c4 100644 --- a/src/mbgl/style/layers/symbol_layer.cpp +++ b/src/mbgl/style/layers/symbol_layer.cpp @@ -3,33 +3,34 @@ #include <mbgl/style/layers/symbol_layer.hpp> #include <mbgl/style/layers/symbol_layer_impl.hpp> #include <mbgl/style/conversion/stringify.hpp> +#include <mbgl/style/layer_observer.hpp> namespace mbgl { namespace style { SymbolLayer::SymbolLayer(const std::string& layerID, const std::string& sourceID) - : Layer(LayerType::Symbol, std::make_unique<Impl>()) - , impl(static_cast<Impl*>(baseImpl.get())) { - impl->id = layerID; - impl->source = sourceID; + : Layer(makeMutable<Impl>(LayerType::Symbol, layerID, sourceID)) { } -SymbolLayer::SymbolLayer(const Impl& other) - : Layer(LayerType::Symbol, std::make_unique<Impl>(other)) - , impl(static_cast<Impl*>(baseImpl.get())) { +SymbolLayer::SymbolLayer(Immutable<Impl> impl_) + : Layer(std::move(impl_)) { } SymbolLayer::~SymbolLayer() = default; -std::unique_ptr<Layer> SymbolLayer::Impl::clone() const { - return std::make_unique<SymbolLayer>(*this); +const SymbolLayer::Impl& SymbolLayer::impl() const { + return static_cast<const Impl&>(*baseImpl); } -std::unique_ptr<Layer> SymbolLayer::Impl::cloneRef(const std::string& id_) const { - auto result = std::make_unique<SymbolLayer>(*this); - result->impl->id = id_; - result->impl->cascading = SymbolPaintProperties::Cascading(); - return std::move(result); +Mutable<SymbolLayer::Impl> SymbolLayer::mutableImpl() const { + return makeMutable<Impl>(impl()); +} + +std::unique_ptr<Layer> SymbolLayer::cloneRef(const std::string& id_) const { + auto impl_ = mutableImpl(); + impl_->id = id_; + impl_->cascading = SymbolPaintProperties::Cascading(); + return std::make_unique<SymbolLayer>(std::move(impl_)); } void SymbolLayer::Impl::stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>& writer) const { @@ -39,26 +40,55 @@ void SymbolLayer::Impl::stringifyLayout(rapidjson::Writer<rapidjson::StringBuffe // Source const std::string& SymbolLayer::getSourceID() const { - return impl->source; + return impl().source; } void SymbolLayer::setSourceLayer(const std::string& sourceLayer) { - impl->sourceLayer = sourceLayer; + auto impl_ = mutableImpl(); + impl_->sourceLayer = sourceLayer; + baseImpl = std::move(impl_); } const std::string& SymbolLayer::getSourceLayer() const { - return impl->sourceLayer; + return impl().sourceLayer; } // Filter void SymbolLayer::setFilter(const Filter& filter) { - impl->filter = filter; - impl->observer->onLayerFilterChanged(*this); + auto impl_ = mutableImpl(); + impl_->filter = filter; + baseImpl = std::move(impl_); + observer->onLayerFilterChanged(*this); } const Filter& SymbolLayer::getFilter() const { - return impl->filter; + return impl().filter; +} + +// Visibility + +void SymbolLayer::setVisibility(VisibilityType value) { + if (value == getVisibility()) + return; + auto impl_ = mutableImpl(); + impl_->visibility = value; + baseImpl = std::move(impl_); + observer->onLayerVisibilityChanged(*this); +} + +// Zoom range + +void SymbolLayer::setMinZoom(float minZoom) { + auto impl_ = mutableImpl(); + impl_->minZoom = minZoom; + baseImpl = std::move(impl_); +} + +void SymbolLayer::setMaxZoom(float maxZoom) { + auto impl_ = mutableImpl(); + impl_->maxZoom = maxZoom; + baseImpl = std::move(impl_); } // Layout properties @@ -68,476 +98,544 @@ PropertyValue<SymbolPlacementType> SymbolLayer::getDefaultSymbolPlacement() { } PropertyValue<SymbolPlacementType> SymbolLayer::getSymbolPlacement() const { - return impl->layout.unevaluated.get<SymbolPlacement>(); + return impl().layout.unevaluated.get<SymbolPlacement>(); } void SymbolLayer::setSymbolPlacement(PropertyValue<SymbolPlacementType> value) { if (value == getSymbolPlacement()) return; - impl->layout.unevaluated.get<SymbolPlacement>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "symbol-placement"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<SymbolPlacement>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "symbol-placement"); } PropertyValue<float> SymbolLayer::getDefaultSymbolSpacing() { return SymbolSpacing::defaultValue(); } PropertyValue<float> SymbolLayer::getSymbolSpacing() const { - return impl->layout.unevaluated.get<SymbolSpacing>(); + return impl().layout.unevaluated.get<SymbolSpacing>(); } void SymbolLayer::setSymbolSpacing(PropertyValue<float> value) { if (value == getSymbolSpacing()) return; - impl->layout.unevaluated.get<SymbolSpacing>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "symbol-spacing"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<SymbolSpacing>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "symbol-spacing"); } PropertyValue<bool> SymbolLayer::getDefaultSymbolAvoidEdges() { return SymbolAvoidEdges::defaultValue(); } PropertyValue<bool> SymbolLayer::getSymbolAvoidEdges() const { - return impl->layout.unevaluated.get<SymbolAvoidEdges>(); + return impl().layout.unevaluated.get<SymbolAvoidEdges>(); } void SymbolLayer::setSymbolAvoidEdges(PropertyValue<bool> value) { if (value == getSymbolAvoidEdges()) return; - impl->layout.unevaluated.get<SymbolAvoidEdges>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "symbol-avoid-edges"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<SymbolAvoidEdges>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "symbol-avoid-edges"); } PropertyValue<bool> SymbolLayer::getDefaultIconAllowOverlap() { return IconAllowOverlap::defaultValue(); } PropertyValue<bool> SymbolLayer::getIconAllowOverlap() const { - return impl->layout.unevaluated.get<IconAllowOverlap>(); + return impl().layout.unevaluated.get<IconAllowOverlap>(); } void SymbolLayer::setIconAllowOverlap(PropertyValue<bool> value) { if (value == getIconAllowOverlap()) return; - impl->layout.unevaluated.get<IconAllowOverlap>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "icon-allow-overlap"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<IconAllowOverlap>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "icon-allow-overlap"); } PropertyValue<bool> SymbolLayer::getDefaultIconIgnorePlacement() { return IconIgnorePlacement::defaultValue(); } PropertyValue<bool> SymbolLayer::getIconIgnorePlacement() const { - return impl->layout.unevaluated.get<IconIgnorePlacement>(); + return impl().layout.unevaluated.get<IconIgnorePlacement>(); } void SymbolLayer::setIconIgnorePlacement(PropertyValue<bool> value) { if (value == getIconIgnorePlacement()) return; - impl->layout.unevaluated.get<IconIgnorePlacement>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "icon-ignore-placement"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<IconIgnorePlacement>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "icon-ignore-placement"); } PropertyValue<bool> SymbolLayer::getDefaultIconOptional() { return IconOptional::defaultValue(); } PropertyValue<bool> SymbolLayer::getIconOptional() const { - return impl->layout.unevaluated.get<IconOptional>(); + return impl().layout.unevaluated.get<IconOptional>(); } void SymbolLayer::setIconOptional(PropertyValue<bool> value) { if (value == getIconOptional()) return; - impl->layout.unevaluated.get<IconOptional>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "icon-optional"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<IconOptional>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "icon-optional"); } PropertyValue<AlignmentType> SymbolLayer::getDefaultIconRotationAlignment() { return IconRotationAlignment::defaultValue(); } PropertyValue<AlignmentType> SymbolLayer::getIconRotationAlignment() const { - return impl->layout.unevaluated.get<IconRotationAlignment>(); + return impl().layout.unevaluated.get<IconRotationAlignment>(); } void SymbolLayer::setIconRotationAlignment(PropertyValue<AlignmentType> value) { if (value == getIconRotationAlignment()) return; - impl->layout.unevaluated.get<IconRotationAlignment>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "icon-rotation-alignment"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<IconRotationAlignment>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "icon-rotation-alignment"); } DataDrivenPropertyValue<float> SymbolLayer::getDefaultIconSize() { return IconSize::defaultValue(); } DataDrivenPropertyValue<float> SymbolLayer::getIconSize() const { - return impl->layout.unevaluated.get<IconSize>(); + return impl().layout.unevaluated.get<IconSize>(); } void SymbolLayer::setIconSize(DataDrivenPropertyValue<float> value) { if (value == getIconSize()) return; - impl->layout.unevaluated.get<IconSize>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "icon-size"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<IconSize>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "icon-size"); } PropertyValue<IconTextFitType> SymbolLayer::getDefaultIconTextFit() { return IconTextFit::defaultValue(); } PropertyValue<IconTextFitType> SymbolLayer::getIconTextFit() const { - return impl->layout.unevaluated.get<IconTextFit>(); + return impl().layout.unevaluated.get<IconTextFit>(); } void SymbolLayer::setIconTextFit(PropertyValue<IconTextFitType> value) { if (value == getIconTextFit()) return; - impl->layout.unevaluated.get<IconTextFit>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "icon-text-fit"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<IconTextFit>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "icon-text-fit"); } PropertyValue<std::array<float, 4>> SymbolLayer::getDefaultIconTextFitPadding() { return IconTextFitPadding::defaultValue(); } PropertyValue<std::array<float, 4>> SymbolLayer::getIconTextFitPadding() const { - return impl->layout.unevaluated.get<IconTextFitPadding>(); + return impl().layout.unevaluated.get<IconTextFitPadding>(); } void SymbolLayer::setIconTextFitPadding(PropertyValue<std::array<float, 4>> value) { if (value == getIconTextFitPadding()) return; - impl->layout.unevaluated.get<IconTextFitPadding>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "icon-text-fit-padding"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<IconTextFitPadding>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "icon-text-fit-padding"); } DataDrivenPropertyValue<std::string> SymbolLayer::getDefaultIconImage() { return IconImage::defaultValue(); } DataDrivenPropertyValue<std::string> SymbolLayer::getIconImage() const { - return impl->layout.unevaluated.get<IconImage>(); + return impl().layout.unevaluated.get<IconImage>(); } void SymbolLayer::setIconImage(DataDrivenPropertyValue<std::string> value) { if (value == getIconImage()) return; - impl->layout.unevaluated.get<IconImage>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "icon-image"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<IconImage>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "icon-image"); } DataDrivenPropertyValue<float> SymbolLayer::getDefaultIconRotate() { return IconRotate::defaultValue(); } DataDrivenPropertyValue<float> SymbolLayer::getIconRotate() const { - return impl->layout.unevaluated.get<IconRotate>(); + return impl().layout.unevaluated.get<IconRotate>(); } void SymbolLayer::setIconRotate(DataDrivenPropertyValue<float> value) { if (value == getIconRotate()) return; - impl->layout.unevaluated.get<IconRotate>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "icon-rotate"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<IconRotate>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "icon-rotate"); } PropertyValue<float> SymbolLayer::getDefaultIconPadding() { return IconPadding::defaultValue(); } PropertyValue<float> SymbolLayer::getIconPadding() const { - return impl->layout.unevaluated.get<IconPadding>(); + return impl().layout.unevaluated.get<IconPadding>(); } void SymbolLayer::setIconPadding(PropertyValue<float> value) { if (value == getIconPadding()) return; - impl->layout.unevaluated.get<IconPadding>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "icon-padding"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<IconPadding>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "icon-padding"); } PropertyValue<bool> SymbolLayer::getDefaultIconKeepUpright() { return IconKeepUpright::defaultValue(); } PropertyValue<bool> SymbolLayer::getIconKeepUpright() const { - return impl->layout.unevaluated.get<IconKeepUpright>(); + return impl().layout.unevaluated.get<IconKeepUpright>(); } void SymbolLayer::setIconKeepUpright(PropertyValue<bool> value) { if (value == getIconKeepUpright()) return; - impl->layout.unevaluated.get<IconKeepUpright>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "icon-keep-upright"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<IconKeepUpright>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "icon-keep-upright"); } DataDrivenPropertyValue<std::array<float, 2>> SymbolLayer::getDefaultIconOffset() { return IconOffset::defaultValue(); } DataDrivenPropertyValue<std::array<float, 2>> SymbolLayer::getIconOffset() const { - return impl->layout.unevaluated.get<IconOffset>(); + return impl().layout.unevaluated.get<IconOffset>(); } void SymbolLayer::setIconOffset(DataDrivenPropertyValue<std::array<float, 2>> value) { if (value == getIconOffset()) return; - impl->layout.unevaluated.get<IconOffset>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "icon-offset"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<IconOffset>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "icon-offset"); } PropertyValue<AlignmentType> SymbolLayer::getDefaultTextPitchAlignment() { return TextPitchAlignment::defaultValue(); } PropertyValue<AlignmentType> SymbolLayer::getTextPitchAlignment() const { - return impl->layout.unevaluated.get<TextPitchAlignment>(); + return impl().layout.unevaluated.get<TextPitchAlignment>(); } void SymbolLayer::setTextPitchAlignment(PropertyValue<AlignmentType> value) { if (value == getTextPitchAlignment()) return; - impl->layout.unevaluated.get<TextPitchAlignment>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "text-pitch-alignment"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<TextPitchAlignment>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "text-pitch-alignment"); } PropertyValue<AlignmentType> SymbolLayer::getDefaultTextRotationAlignment() { return TextRotationAlignment::defaultValue(); } PropertyValue<AlignmentType> SymbolLayer::getTextRotationAlignment() const { - return impl->layout.unevaluated.get<TextRotationAlignment>(); + return impl().layout.unevaluated.get<TextRotationAlignment>(); } void SymbolLayer::setTextRotationAlignment(PropertyValue<AlignmentType> value) { if (value == getTextRotationAlignment()) return; - impl->layout.unevaluated.get<TextRotationAlignment>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "text-rotation-alignment"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<TextRotationAlignment>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "text-rotation-alignment"); } DataDrivenPropertyValue<std::string> SymbolLayer::getDefaultTextField() { return TextField::defaultValue(); } DataDrivenPropertyValue<std::string> SymbolLayer::getTextField() const { - return impl->layout.unevaluated.get<TextField>(); + return impl().layout.unevaluated.get<TextField>(); } void SymbolLayer::setTextField(DataDrivenPropertyValue<std::string> value) { if (value == getTextField()) return; - impl->layout.unevaluated.get<TextField>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "text-field"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<TextField>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "text-field"); } PropertyValue<std::vector<std::string>> SymbolLayer::getDefaultTextFont() { return TextFont::defaultValue(); } PropertyValue<std::vector<std::string>> SymbolLayer::getTextFont() const { - return impl->layout.unevaluated.get<TextFont>(); + return impl().layout.unevaluated.get<TextFont>(); } void SymbolLayer::setTextFont(PropertyValue<std::vector<std::string>> value) { if (value == getTextFont()) return; - impl->layout.unevaluated.get<TextFont>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "text-font"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<TextFont>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "text-font"); } DataDrivenPropertyValue<float> SymbolLayer::getDefaultTextSize() { return TextSize::defaultValue(); } DataDrivenPropertyValue<float> SymbolLayer::getTextSize() const { - return impl->layout.unevaluated.get<TextSize>(); + return impl().layout.unevaluated.get<TextSize>(); } void SymbolLayer::setTextSize(DataDrivenPropertyValue<float> value) { if (value == getTextSize()) return; - impl->layout.unevaluated.get<TextSize>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "text-size"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<TextSize>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "text-size"); } PropertyValue<float> SymbolLayer::getDefaultTextMaxWidth() { return TextMaxWidth::defaultValue(); } PropertyValue<float> SymbolLayer::getTextMaxWidth() const { - return impl->layout.unevaluated.get<TextMaxWidth>(); + return impl().layout.unevaluated.get<TextMaxWidth>(); } void SymbolLayer::setTextMaxWidth(PropertyValue<float> value) { if (value == getTextMaxWidth()) return; - impl->layout.unevaluated.get<TextMaxWidth>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "text-max-width"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<TextMaxWidth>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "text-max-width"); } PropertyValue<float> SymbolLayer::getDefaultTextLineHeight() { return TextLineHeight::defaultValue(); } PropertyValue<float> SymbolLayer::getTextLineHeight() const { - return impl->layout.unevaluated.get<TextLineHeight>(); + return impl().layout.unevaluated.get<TextLineHeight>(); } void SymbolLayer::setTextLineHeight(PropertyValue<float> value) { if (value == getTextLineHeight()) return; - impl->layout.unevaluated.get<TextLineHeight>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "text-line-height"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<TextLineHeight>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "text-line-height"); } PropertyValue<float> SymbolLayer::getDefaultTextLetterSpacing() { return TextLetterSpacing::defaultValue(); } PropertyValue<float> SymbolLayer::getTextLetterSpacing() const { - return impl->layout.unevaluated.get<TextLetterSpacing>(); + return impl().layout.unevaluated.get<TextLetterSpacing>(); } void SymbolLayer::setTextLetterSpacing(PropertyValue<float> value) { if (value == getTextLetterSpacing()) return; - impl->layout.unevaluated.get<TextLetterSpacing>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "text-letter-spacing"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<TextLetterSpacing>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "text-letter-spacing"); } PropertyValue<TextJustifyType> SymbolLayer::getDefaultTextJustify() { return TextJustify::defaultValue(); } PropertyValue<TextJustifyType> SymbolLayer::getTextJustify() const { - return impl->layout.unevaluated.get<TextJustify>(); + return impl().layout.unevaluated.get<TextJustify>(); } void SymbolLayer::setTextJustify(PropertyValue<TextJustifyType> value) { if (value == getTextJustify()) return; - impl->layout.unevaluated.get<TextJustify>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "text-justify"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<TextJustify>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "text-justify"); } PropertyValue<TextAnchorType> SymbolLayer::getDefaultTextAnchor() { return TextAnchor::defaultValue(); } PropertyValue<TextAnchorType> SymbolLayer::getTextAnchor() const { - return impl->layout.unevaluated.get<TextAnchor>(); + return impl().layout.unevaluated.get<TextAnchor>(); } void SymbolLayer::setTextAnchor(PropertyValue<TextAnchorType> value) { if (value == getTextAnchor()) return; - impl->layout.unevaluated.get<TextAnchor>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "text-anchor"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<TextAnchor>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "text-anchor"); } PropertyValue<float> SymbolLayer::getDefaultTextMaxAngle() { return TextMaxAngle::defaultValue(); } PropertyValue<float> SymbolLayer::getTextMaxAngle() const { - return impl->layout.unevaluated.get<TextMaxAngle>(); + return impl().layout.unevaluated.get<TextMaxAngle>(); } void SymbolLayer::setTextMaxAngle(PropertyValue<float> value) { if (value == getTextMaxAngle()) return; - impl->layout.unevaluated.get<TextMaxAngle>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "text-max-angle"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<TextMaxAngle>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "text-max-angle"); } DataDrivenPropertyValue<float> SymbolLayer::getDefaultTextRotate() { return TextRotate::defaultValue(); } DataDrivenPropertyValue<float> SymbolLayer::getTextRotate() const { - return impl->layout.unevaluated.get<TextRotate>(); + return impl().layout.unevaluated.get<TextRotate>(); } void SymbolLayer::setTextRotate(DataDrivenPropertyValue<float> value) { if (value == getTextRotate()) return; - impl->layout.unevaluated.get<TextRotate>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "text-rotate"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<TextRotate>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "text-rotate"); } PropertyValue<float> SymbolLayer::getDefaultTextPadding() { return TextPadding::defaultValue(); } PropertyValue<float> SymbolLayer::getTextPadding() const { - return impl->layout.unevaluated.get<TextPadding>(); + return impl().layout.unevaluated.get<TextPadding>(); } void SymbolLayer::setTextPadding(PropertyValue<float> value) { if (value == getTextPadding()) return; - impl->layout.unevaluated.get<TextPadding>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "text-padding"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<TextPadding>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "text-padding"); } PropertyValue<bool> SymbolLayer::getDefaultTextKeepUpright() { return TextKeepUpright::defaultValue(); } PropertyValue<bool> SymbolLayer::getTextKeepUpright() const { - return impl->layout.unevaluated.get<TextKeepUpright>(); + return impl().layout.unevaluated.get<TextKeepUpright>(); } void SymbolLayer::setTextKeepUpright(PropertyValue<bool> value) { if (value == getTextKeepUpright()) return; - impl->layout.unevaluated.get<TextKeepUpright>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "text-keep-upright"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<TextKeepUpright>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "text-keep-upright"); } DataDrivenPropertyValue<TextTransformType> SymbolLayer::getDefaultTextTransform() { return TextTransform::defaultValue(); } DataDrivenPropertyValue<TextTransformType> SymbolLayer::getTextTransform() const { - return impl->layout.unevaluated.get<TextTransform>(); + return impl().layout.unevaluated.get<TextTransform>(); } void SymbolLayer::setTextTransform(DataDrivenPropertyValue<TextTransformType> value) { if (value == getTextTransform()) return; - impl->layout.unevaluated.get<TextTransform>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "text-transform"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<TextTransform>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "text-transform"); } DataDrivenPropertyValue<std::array<float, 2>> SymbolLayer::getDefaultTextOffset() { return TextOffset::defaultValue(); } DataDrivenPropertyValue<std::array<float, 2>> SymbolLayer::getTextOffset() const { - return impl->layout.unevaluated.get<TextOffset>(); + return impl().layout.unevaluated.get<TextOffset>(); } void SymbolLayer::setTextOffset(DataDrivenPropertyValue<std::array<float, 2>> value) { if (value == getTextOffset()) return; - impl->layout.unevaluated.get<TextOffset>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "text-offset"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<TextOffset>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "text-offset"); } PropertyValue<bool> SymbolLayer::getDefaultTextAllowOverlap() { return TextAllowOverlap::defaultValue(); } PropertyValue<bool> SymbolLayer::getTextAllowOverlap() const { - return impl->layout.unevaluated.get<TextAllowOverlap>(); + return impl().layout.unevaluated.get<TextAllowOverlap>(); } void SymbolLayer::setTextAllowOverlap(PropertyValue<bool> value) { if (value == getTextAllowOverlap()) return; - impl->layout.unevaluated.get<TextAllowOverlap>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "text-allow-overlap"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<TextAllowOverlap>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "text-allow-overlap"); } PropertyValue<bool> SymbolLayer::getDefaultTextIgnorePlacement() { return TextIgnorePlacement::defaultValue(); } PropertyValue<bool> SymbolLayer::getTextIgnorePlacement() const { - return impl->layout.unevaluated.get<TextIgnorePlacement>(); + return impl().layout.unevaluated.get<TextIgnorePlacement>(); } void SymbolLayer::setTextIgnorePlacement(PropertyValue<bool> value) { if (value == getTextIgnorePlacement()) return; - impl->layout.unevaluated.get<TextIgnorePlacement>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "text-ignore-placement"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<TextIgnorePlacement>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "text-ignore-placement"); } PropertyValue<bool> SymbolLayer::getDefaultTextOptional() { return TextOptional::defaultValue(); } PropertyValue<bool> SymbolLayer::getTextOptional() const { - return impl->layout.unevaluated.get<TextOptional>(); + return impl().layout.unevaluated.get<TextOptional>(); } void SymbolLayer::setTextOptional(PropertyValue<bool> value) { if (value == getTextOptional()) return; - impl->layout.unevaluated.get<TextOptional>() = value; - impl->observer->onLayerLayoutPropertyChanged(*this, "text-optional"); + auto impl_ = mutableImpl(); + impl_->layout.unevaluated.get<TextOptional>() = value; + baseImpl = std::move(impl_); + observer->onLayerLayoutPropertyChanged(*this, "text-optional"); } // Paint properties @@ -547,26 +645,30 @@ DataDrivenPropertyValue<float> SymbolLayer::getDefaultIconOpacity() { } DataDrivenPropertyValue<float> SymbolLayer::getIconOpacity(const optional<std::string>& klass) const { - return impl->cascading.template get<IconOpacity>().get(klass); + return impl().cascading.template get<IconOpacity>().get(klass); } void SymbolLayer::setIconOpacity(DataDrivenPropertyValue<float> value, const optional<std::string>& klass) { if (value == getIconOpacity(klass)) return; - impl->cascading.template get<IconOpacity>().set(value, klass); + auto impl_ = mutableImpl(); + impl_->cascading.template get<IconOpacity>().set(value, klass); + baseImpl = std::move(impl_); if (value.isDataDriven()) { - impl->observer->onLayerDataDrivenPaintPropertyChanged(*this); + observer->onLayerDataDrivenPaintPropertyChanged(*this); } else { - impl->observer->onLayerPaintPropertyChanged(*this); + observer->onLayerPaintPropertyChanged(*this); } } void SymbolLayer::setIconOpacityTransition(const TransitionOptions& value, const optional<std::string>& klass) { - impl->cascading.template get<IconOpacity>().setTransition(value, klass); + auto impl_ = mutableImpl(); + impl_->cascading.template get<IconOpacity>().setTransition(value, klass); + baseImpl = std::move(impl_); } TransitionOptions SymbolLayer::getIconOpacityTransition(const optional<std::string>& klass) const { - return impl->cascading.template get<IconOpacity>().getTransition(klass); + return impl().cascading.template get<IconOpacity>().getTransition(klass); } DataDrivenPropertyValue<Color> SymbolLayer::getDefaultIconColor() { @@ -574,26 +676,30 @@ DataDrivenPropertyValue<Color> SymbolLayer::getDefaultIconColor() { } DataDrivenPropertyValue<Color> SymbolLayer::getIconColor(const optional<std::string>& klass) const { - return impl->cascading.template get<IconColor>().get(klass); + return impl().cascading.template get<IconColor>().get(klass); } void SymbolLayer::setIconColor(DataDrivenPropertyValue<Color> value, const optional<std::string>& klass) { if (value == getIconColor(klass)) return; - impl->cascading.template get<IconColor>().set(value, klass); + auto impl_ = mutableImpl(); + impl_->cascading.template get<IconColor>().set(value, klass); + baseImpl = std::move(impl_); if (value.isDataDriven()) { - impl->observer->onLayerDataDrivenPaintPropertyChanged(*this); + observer->onLayerDataDrivenPaintPropertyChanged(*this); } else { - impl->observer->onLayerPaintPropertyChanged(*this); + observer->onLayerPaintPropertyChanged(*this); } } void SymbolLayer::setIconColorTransition(const TransitionOptions& value, const optional<std::string>& klass) { - impl->cascading.template get<IconColor>().setTransition(value, klass); + auto impl_ = mutableImpl(); + impl_->cascading.template get<IconColor>().setTransition(value, klass); + baseImpl = std::move(impl_); } TransitionOptions SymbolLayer::getIconColorTransition(const optional<std::string>& klass) const { - return impl->cascading.template get<IconColor>().getTransition(klass); + return impl().cascading.template get<IconColor>().getTransition(klass); } DataDrivenPropertyValue<Color> SymbolLayer::getDefaultIconHaloColor() { @@ -601,26 +707,30 @@ DataDrivenPropertyValue<Color> SymbolLayer::getDefaultIconHaloColor() { } DataDrivenPropertyValue<Color> SymbolLayer::getIconHaloColor(const optional<std::string>& klass) const { - return impl->cascading.template get<IconHaloColor>().get(klass); + return impl().cascading.template get<IconHaloColor>().get(klass); } void SymbolLayer::setIconHaloColor(DataDrivenPropertyValue<Color> value, const optional<std::string>& klass) { if (value == getIconHaloColor(klass)) return; - impl->cascading.template get<IconHaloColor>().set(value, klass); + auto impl_ = mutableImpl(); + impl_->cascading.template get<IconHaloColor>().set(value, klass); + baseImpl = std::move(impl_); if (value.isDataDriven()) { - impl->observer->onLayerDataDrivenPaintPropertyChanged(*this); + observer->onLayerDataDrivenPaintPropertyChanged(*this); } else { - impl->observer->onLayerPaintPropertyChanged(*this); + observer->onLayerPaintPropertyChanged(*this); } } void SymbolLayer::setIconHaloColorTransition(const TransitionOptions& value, const optional<std::string>& klass) { - impl->cascading.template get<IconHaloColor>().setTransition(value, klass); + auto impl_ = mutableImpl(); + impl_->cascading.template get<IconHaloColor>().setTransition(value, klass); + baseImpl = std::move(impl_); } TransitionOptions SymbolLayer::getIconHaloColorTransition(const optional<std::string>& klass) const { - return impl->cascading.template get<IconHaloColor>().getTransition(klass); + return impl().cascading.template get<IconHaloColor>().getTransition(klass); } DataDrivenPropertyValue<float> SymbolLayer::getDefaultIconHaloWidth() { @@ -628,26 +738,30 @@ DataDrivenPropertyValue<float> SymbolLayer::getDefaultIconHaloWidth() { } DataDrivenPropertyValue<float> SymbolLayer::getIconHaloWidth(const optional<std::string>& klass) const { - return impl->cascading.template get<IconHaloWidth>().get(klass); + return impl().cascading.template get<IconHaloWidth>().get(klass); } void SymbolLayer::setIconHaloWidth(DataDrivenPropertyValue<float> value, const optional<std::string>& klass) { if (value == getIconHaloWidth(klass)) return; - impl->cascading.template get<IconHaloWidth>().set(value, klass); + auto impl_ = mutableImpl(); + impl_->cascading.template get<IconHaloWidth>().set(value, klass); + baseImpl = std::move(impl_); if (value.isDataDriven()) { - impl->observer->onLayerDataDrivenPaintPropertyChanged(*this); + observer->onLayerDataDrivenPaintPropertyChanged(*this); } else { - impl->observer->onLayerPaintPropertyChanged(*this); + observer->onLayerPaintPropertyChanged(*this); } } void SymbolLayer::setIconHaloWidthTransition(const TransitionOptions& value, const optional<std::string>& klass) { - impl->cascading.template get<IconHaloWidth>().setTransition(value, klass); + auto impl_ = mutableImpl(); + impl_->cascading.template get<IconHaloWidth>().setTransition(value, klass); + baseImpl = std::move(impl_); } TransitionOptions SymbolLayer::getIconHaloWidthTransition(const optional<std::string>& klass) const { - return impl->cascading.template get<IconHaloWidth>().getTransition(klass); + return impl().cascading.template get<IconHaloWidth>().getTransition(klass); } DataDrivenPropertyValue<float> SymbolLayer::getDefaultIconHaloBlur() { @@ -655,26 +769,30 @@ DataDrivenPropertyValue<float> SymbolLayer::getDefaultIconHaloBlur() { } DataDrivenPropertyValue<float> SymbolLayer::getIconHaloBlur(const optional<std::string>& klass) const { - return impl->cascading.template get<IconHaloBlur>().get(klass); + return impl().cascading.template get<IconHaloBlur>().get(klass); } void SymbolLayer::setIconHaloBlur(DataDrivenPropertyValue<float> value, const optional<std::string>& klass) { if (value == getIconHaloBlur(klass)) return; - impl->cascading.template get<IconHaloBlur>().set(value, klass); + auto impl_ = mutableImpl(); + impl_->cascading.template get<IconHaloBlur>().set(value, klass); + baseImpl = std::move(impl_); if (value.isDataDriven()) { - impl->observer->onLayerDataDrivenPaintPropertyChanged(*this); + observer->onLayerDataDrivenPaintPropertyChanged(*this); } else { - impl->observer->onLayerPaintPropertyChanged(*this); + observer->onLayerPaintPropertyChanged(*this); } } void SymbolLayer::setIconHaloBlurTransition(const TransitionOptions& value, const optional<std::string>& klass) { - impl->cascading.template get<IconHaloBlur>().setTransition(value, klass); + auto impl_ = mutableImpl(); + impl_->cascading.template get<IconHaloBlur>().setTransition(value, klass); + baseImpl = std::move(impl_); } TransitionOptions SymbolLayer::getIconHaloBlurTransition(const optional<std::string>& klass) const { - return impl->cascading.template get<IconHaloBlur>().getTransition(klass); + return impl().cascading.template get<IconHaloBlur>().getTransition(klass); } PropertyValue<std::array<float, 2>> SymbolLayer::getDefaultIconTranslate() { @@ -682,22 +800,26 @@ PropertyValue<std::array<float, 2>> SymbolLayer::getDefaultIconTranslate() { } PropertyValue<std::array<float, 2>> SymbolLayer::getIconTranslate(const optional<std::string>& klass) const { - return impl->cascading.template get<IconTranslate>().get(klass); + return impl().cascading.template get<IconTranslate>().get(klass); } void SymbolLayer::setIconTranslate(PropertyValue<std::array<float, 2>> value, const optional<std::string>& klass) { if (value == getIconTranslate(klass)) return; - impl->cascading.template get<IconTranslate>().set(value, klass); - impl->observer->onLayerPaintPropertyChanged(*this); + auto impl_ = mutableImpl(); + impl_->cascading.template get<IconTranslate>().set(value, klass); + baseImpl = std::move(impl_); + observer->onLayerPaintPropertyChanged(*this); } void SymbolLayer::setIconTranslateTransition(const TransitionOptions& value, const optional<std::string>& klass) { - impl->cascading.template get<IconTranslate>().setTransition(value, klass); + auto impl_ = mutableImpl(); + impl_->cascading.template get<IconTranslate>().setTransition(value, klass); + baseImpl = std::move(impl_); } TransitionOptions SymbolLayer::getIconTranslateTransition(const optional<std::string>& klass) const { - return impl->cascading.template get<IconTranslate>().getTransition(klass); + return impl().cascading.template get<IconTranslate>().getTransition(klass); } PropertyValue<TranslateAnchorType> SymbolLayer::getDefaultIconTranslateAnchor() { @@ -705,22 +827,26 @@ PropertyValue<TranslateAnchorType> SymbolLayer::getDefaultIconTranslateAnchor() } PropertyValue<TranslateAnchorType> SymbolLayer::getIconTranslateAnchor(const optional<std::string>& klass) const { - return impl->cascading.template get<IconTranslateAnchor>().get(klass); + return impl().cascading.template get<IconTranslateAnchor>().get(klass); } void SymbolLayer::setIconTranslateAnchor(PropertyValue<TranslateAnchorType> value, const optional<std::string>& klass) { if (value == getIconTranslateAnchor(klass)) return; - impl->cascading.template get<IconTranslateAnchor>().set(value, klass); - impl->observer->onLayerPaintPropertyChanged(*this); + auto impl_ = mutableImpl(); + impl_->cascading.template get<IconTranslateAnchor>().set(value, klass); + baseImpl = std::move(impl_); + observer->onLayerPaintPropertyChanged(*this); } void SymbolLayer::setIconTranslateAnchorTransition(const TransitionOptions& value, const optional<std::string>& klass) { - impl->cascading.template get<IconTranslateAnchor>().setTransition(value, klass); + auto impl_ = mutableImpl(); + impl_->cascading.template get<IconTranslateAnchor>().setTransition(value, klass); + baseImpl = std::move(impl_); } TransitionOptions SymbolLayer::getIconTranslateAnchorTransition(const optional<std::string>& klass) const { - return impl->cascading.template get<IconTranslateAnchor>().getTransition(klass); + return impl().cascading.template get<IconTranslateAnchor>().getTransition(klass); } DataDrivenPropertyValue<float> SymbolLayer::getDefaultTextOpacity() { @@ -728,26 +854,30 @@ DataDrivenPropertyValue<float> SymbolLayer::getDefaultTextOpacity() { } DataDrivenPropertyValue<float> SymbolLayer::getTextOpacity(const optional<std::string>& klass) const { - return impl->cascading.template get<TextOpacity>().get(klass); + return impl().cascading.template get<TextOpacity>().get(klass); } void SymbolLayer::setTextOpacity(DataDrivenPropertyValue<float> value, const optional<std::string>& klass) { if (value == getTextOpacity(klass)) return; - impl->cascading.template get<TextOpacity>().set(value, klass); + auto impl_ = mutableImpl(); + impl_->cascading.template get<TextOpacity>().set(value, klass); + baseImpl = std::move(impl_); if (value.isDataDriven()) { - impl->observer->onLayerDataDrivenPaintPropertyChanged(*this); + observer->onLayerDataDrivenPaintPropertyChanged(*this); } else { - impl->observer->onLayerPaintPropertyChanged(*this); + observer->onLayerPaintPropertyChanged(*this); } } void SymbolLayer::setTextOpacityTransition(const TransitionOptions& value, const optional<std::string>& klass) { - impl->cascading.template get<TextOpacity>().setTransition(value, klass); + auto impl_ = mutableImpl(); + impl_->cascading.template get<TextOpacity>().setTransition(value, klass); + baseImpl = std::move(impl_); } TransitionOptions SymbolLayer::getTextOpacityTransition(const optional<std::string>& klass) const { - return impl->cascading.template get<TextOpacity>().getTransition(klass); + return impl().cascading.template get<TextOpacity>().getTransition(klass); } DataDrivenPropertyValue<Color> SymbolLayer::getDefaultTextColor() { @@ -755,26 +885,30 @@ DataDrivenPropertyValue<Color> SymbolLayer::getDefaultTextColor() { } DataDrivenPropertyValue<Color> SymbolLayer::getTextColor(const optional<std::string>& klass) const { - return impl->cascading.template get<TextColor>().get(klass); + return impl().cascading.template get<TextColor>().get(klass); } void SymbolLayer::setTextColor(DataDrivenPropertyValue<Color> value, const optional<std::string>& klass) { if (value == getTextColor(klass)) return; - impl->cascading.template get<TextColor>().set(value, klass); + auto impl_ = mutableImpl(); + impl_->cascading.template get<TextColor>().set(value, klass); + baseImpl = std::move(impl_); if (value.isDataDriven()) { - impl->observer->onLayerDataDrivenPaintPropertyChanged(*this); + observer->onLayerDataDrivenPaintPropertyChanged(*this); } else { - impl->observer->onLayerPaintPropertyChanged(*this); + observer->onLayerPaintPropertyChanged(*this); } } void SymbolLayer::setTextColorTransition(const TransitionOptions& value, const optional<std::string>& klass) { - impl->cascading.template get<TextColor>().setTransition(value, klass); + auto impl_ = mutableImpl(); + impl_->cascading.template get<TextColor>().setTransition(value, klass); + baseImpl = std::move(impl_); } TransitionOptions SymbolLayer::getTextColorTransition(const optional<std::string>& klass) const { - return impl->cascading.template get<TextColor>().getTransition(klass); + return impl().cascading.template get<TextColor>().getTransition(klass); } DataDrivenPropertyValue<Color> SymbolLayer::getDefaultTextHaloColor() { @@ -782,26 +916,30 @@ DataDrivenPropertyValue<Color> SymbolLayer::getDefaultTextHaloColor() { } DataDrivenPropertyValue<Color> SymbolLayer::getTextHaloColor(const optional<std::string>& klass) const { - return impl->cascading.template get<TextHaloColor>().get(klass); + return impl().cascading.template get<TextHaloColor>().get(klass); } void SymbolLayer::setTextHaloColor(DataDrivenPropertyValue<Color> value, const optional<std::string>& klass) { if (value == getTextHaloColor(klass)) return; - impl->cascading.template get<TextHaloColor>().set(value, klass); + auto impl_ = mutableImpl(); + impl_->cascading.template get<TextHaloColor>().set(value, klass); + baseImpl = std::move(impl_); if (value.isDataDriven()) { - impl->observer->onLayerDataDrivenPaintPropertyChanged(*this); + observer->onLayerDataDrivenPaintPropertyChanged(*this); } else { - impl->observer->onLayerPaintPropertyChanged(*this); + observer->onLayerPaintPropertyChanged(*this); } } void SymbolLayer::setTextHaloColorTransition(const TransitionOptions& value, const optional<std::string>& klass) { - impl->cascading.template get<TextHaloColor>().setTransition(value, klass); + auto impl_ = mutableImpl(); + impl_->cascading.template get<TextHaloColor>().setTransition(value, klass); + baseImpl = std::move(impl_); } TransitionOptions SymbolLayer::getTextHaloColorTransition(const optional<std::string>& klass) const { - return impl->cascading.template get<TextHaloColor>().getTransition(klass); + return impl().cascading.template get<TextHaloColor>().getTransition(klass); } DataDrivenPropertyValue<float> SymbolLayer::getDefaultTextHaloWidth() { @@ -809,26 +947,30 @@ DataDrivenPropertyValue<float> SymbolLayer::getDefaultTextHaloWidth() { } DataDrivenPropertyValue<float> SymbolLayer::getTextHaloWidth(const optional<std::string>& klass) const { - return impl->cascading.template get<TextHaloWidth>().get(klass); + return impl().cascading.template get<TextHaloWidth>().get(klass); } void SymbolLayer::setTextHaloWidth(DataDrivenPropertyValue<float> value, const optional<std::string>& klass) { if (value == getTextHaloWidth(klass)) return; - impl->cascading.template get<TextHaloWidth>().set(value, klass); + auto impl_ = mutableImpl(); + impl_->cascading.template get<TextHaloWidth>().set(value, klass); + baseImpl = std::move(impl_); if (value.isDataDriven()) { - impl->observer->onLayerDataDrivenPaintPropertyChanged(*this); + observer->onLayerDataDrivenPaintPropertyChanged(*this); } else { - impl->observer->onLayerPaintPropertyChanged(*this); + observer->onLayerPaintPropertyChanged(*this); } } void SymbolLayer::setTextHaloWidthTransition(const TransitionOptions& value, const optional<std::string>& klass) { - impl->cascading.template get<TextHaloWidth>().setTransition(value, klass); + auto impl_ = mutableImpl(); + impl_->cascading.template get<TextHaloWidth>().setTransition(value, klass); + baseImpl = std::move(impl_); } TransitionOptions SymbolLayer::getTextHaloWidthTransition(const optional<std::string>& klass) const { - return impl->cascading.template get<TextHaloWidth>().getTransition(klass); + return impl().cascading.template get<TextHaloWidth>().getTransition(klass); } DataDrivenPropertyValue<float> SymbolLayer::getDefaultTextHaloBlur() { @@ -836,26 +978,30 @@ DataDrivenPropertyValue<float> SymbolLayer::getDefaultTextHaloBlur() { } DataDrivenPropertyValue<float> SymbolLayer::getTextHaloBlur(const optional<std::string>& klass) const { - return impl->cascading.template get<TextHaloBlur>().get(klass); + return impl().cascading.template get<TextHaloBlur>().get(klass); } void SymbolLayer::setTextHaloBlur(DataDrivenPropertyValue<float> value, const optional<std::string>& klass) { if (value == getTextHaloBlur(klass)) return; - impl->cascading.template get<TextHaloBlur>().set(value, klass); + auto impl_ = mutableImpl(); + impl_->cascading.template get<TextHaloBlur>().set(value, klass); + baseImpl = std::move(impl_); if (value.isDataDriven()) { - impl->observer->onLayerDataDrivenPaintPropertyChanged(*this); + observer->onLayerDataDrivenPaintPropertyChanged(*this); } else { - impl->observer->onLayerPaintPropertyChanged(*this); + observer->onLayerPaintPropertyChanged(*this); } } void SymbolLayer::setTextHaloBlurTransition(const TransitionOptions& value, const optional<std::string>& klass) { - impl->cascading.template get<TextHaloBlur>().setTransition(value, klass); + auto impl_ = mutableImpl(); + impl_->cascading.template get<TextHaloBlur>().setTransition(value, klass); + baseImpl = std::move(impl_); } TransitionOptions SymbolLayer::getTextHaloBlurTransition(const optional<std::string>& klass) const { - return impl->cascading.template get<TextHaloBlur>().getTransition(klass); + return impl().cascading.template get<TextHaloBlur>().getTransition(klass); } PropertyValue<std::array<float, 2>> SymbolLayer::getDefaultTextTranslate() { @@ -863,22 +1009,26 @@ PropertyValue<std::array<float, 2>> SymbolLayer::getDefaultTextTranslate() { } PropertyValue<std::array<float, 2>> SymbolLayer::getTextTranslate(const optional<std::string>& klass) const { - return impl->cascading.template get<TextTranslate>().get(klass); + return impl().cascading.template get<TextTranslate>().get(klass); } void SymbolLayer::setTextTranslate(PropertyValue<std::array<float, 2>> value, const optional<std::string>& klass) { if (value == getTextTranslate(klass)) return; - impl->cascading.template get<TextTranslate>().set(value, klass); - impl->observer->onLayerPaintPropertyChanged(*this); + auto impl_ = mutableImpl(); + impl_->cascading.template get<TextTranslate>().set(value, klass); + baseImpl = std::move(impl_); + observer->onLayerPaintPropertyChanged(*this); } void SymbolLayer::setTextTranslateTransition(const TransitionOptions& value, const optional<std::string>& klass) { - impl->cascading.template get<TextTranslate>().setTransition(value, klass); + auto impl_ = mutableImpl(); + impl_->cascading.template get<TextTranslate>().setTransition(value, klass); + baseImpl = std::move(impl_); } TransitionOptions SymbolLayer::getTextTranslateTransition(const optional<std::string>& klass) const { - return impl->cascading.template get<TextTranslate>().getTransition(klass); + return impl().cascading.template get<TextTranslate>().getTransition(klass); } PropertyValue<TranslateAnchorType> SymbolLayer::getDefaultTextTranslateAnchor() { @@ -886,22 +1036,26 @@ PropertyValue<TranslateAnchorType> SymbolLayer::getDefaultTextTranslateAnchor() } PropertyValue<TranslateAnchorType> SymbolLayer::getTextTranslateAnchor(const optional<std::string>& klass) const { - return impl->cascading.template get<TextTranslateAnchor>().get(klass); + return impl().cascading.template get<TextTranslateAnchor>().get(klass); } void SymbolLayer::setTextTranslateAnchor(PropertyValue<TranslateAnchorType> value, const optional<std::string>& klass) { if (value == getTextTranslateAnchor(klass)) return; - impl->cascading.template get<TextTranslateAnchor>().set(value, klass); - impl->observer->onLayerPaintPropertyChanged(*this); + auto impl_ = mutableImpl(); + impl_->cascading.template get<TextTranslateAnchor>().set(value, klass); + baseImpl = std::move(impl_); + observer->onLayerPaintPropertyChanged(*this); } void SymbolLayer::setTextTranslateAnchorTransition(const TransitionOptions& value, const optional<std::string>& klass) { - impl->cascading.template get<TextTranslateAnchor>().setTransition(value, klass); + auto impl_ = mutableImpl(); + impl_->cascading.template get<TextTranslateAnchor>().setTransition(value, klass); + baseImpl = std::move(impl_); } TransitionOptions SymbolLayer::getTextTranslateAnchorTransition(const optional<std::string>& klass) const { - return impl->cascading.template get<TextTranslateAnchor>().getTransition(klass); + return impl().cascading.template get<TextTranslateAnchor>().getTransition(klass); } } // namespace style |