[core] Add getSharedExpression to property expression

New method can be used for aggregating property expressions from
multiple properties(layers) into single match / case expression.
This commit is contained in:
Alexander Shalamov
2020-02-03 12:32:16 +02:00
parent a600a1c318
commit 0b727108c8
2 changed files with 9 additions and 0 deletions

View File

@@ -21,6 +21,11 @@ public:
Range<float> getCoveringStops(const float, const float) const noexcept;
const expression::Expression& getExpression() const noexcept;
// Can be used for aggregating property expressions from multiple
// properties(layers) into single match / case expression. Method may
// be removed if a better way of aggregation is found.
std::shared_ptr<const expression::Expression> getSharedExpression() const noexcept;
bool useIntegerZoom = false;
protected:

View File

@@ -54,5 +54,9 @@ const expression::Expression& PropertyExpressionBase::getExpression() const noex
return *expression;
}
std::shared_ptr<const expression::Expression> PropertyExpressionBase::getSharedExpression() const noexcept {
return expression;
}
} // namespace style
} // namespace mbgl