1#pragma once
2
3#include <mbgl/style/expression/expression.hpp>
4#include <mbgl/style/expression/compound_expression.hpp>
5
6namespace mbgl {
7namespace style {
8namespace expression {
9
10template <typename T>
11bool isGlobalPropertyConstant(const Expression& expression, const T& properties) {
12 if (expression.getKind() == Kind::CompoundExpression) {
13 auto e = static_cast<const CompoundExpressionBase*>(&expression);
14 for (const std::string& property : properties) {
15 if (e->getName() == property) {
16 return false;
17 }
18 }
19 }
20
21 bool isConstant = true;
22 expression.eachChild([&](const Expression& e) {
23 if (isConstant && !isGlobalPropertyConstant(e, properties)) {
24 isConstant = false;
25 }
26 });
27 return isConstant;
28};
29
30bool isFeatureConstant(const Expression& expression);
31bool isZoomConstant(const Expression& e);
32
33
34} // namespace expression
35} // namespace style
36} // namespace mbgl
37

source code of qtlocation/src/3rdparty/mapbox-gl-native/include/mbgl/style/expression/is_constant.hpp