4 #include <mbgl/renderer/possibly_evaluated_property_value.hpp>
14 PossiblyEvaluatedPropertyValue<T> defaultValue_,
17 defaultValue(
std::move(defaultValue_)),
18 propertyName(
std::move(propertyName_))
22 using Object = std::unordered_map<std::string, expression::Value>;
23 if (context.formattedSection &&
24 context.formattedSection->is<
Object>()) {
25 const auto& section = context.formattedSection->get<
Object>();
26 if (section.find(propertyName) != section.end()) {
27 return section.at(propertyName);
31 return defaultValue.match(
46 if (
getType() != other->getType() || propertyName != other->propertyName) {
51 return defaultValue.match(
54 return thisExpr == otherExpr;
60 [other] (
const T& thisValue) {
61 return other->defaultValue.match([&thisValue] (
const T& otherValue) {
62 return thisValue == otherValue;
74 return {std::nullopt};
80 PossiblyEvaluatedPropertyValue<T> defaultValue;
const expression::Expression & getExpression() const noexcept
type::Type getType() const
virtual EvaluationResult evaluate(const EvaluationContext ¶ms) const =0
std::unique_ptr< Expression > string(std::unique_ptr< Expression >, std::unique_ptr< Expression > def=nullptr)
constexpr ObjectType Object
variant< NullType, NumberType, BooleanType, StringType, ColorType, ObjectType, ValueType, mapbox::util::recursive_wrapper< Array >, CollatorType, FormattedType, ErrorType, ImageType > Type