diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2018-01-05 12:40:54 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2018-01-10 15:31:12 -0800 |
commit | 76ed5079a547e9f98616a9401c8814d224cec9d8 (patch) | |
tree | 4bad1bcefd0744a0262d6973b825a977fa2cfe45 /include/mbgl/style/expression/expression.hpp | |
parent | 158bd5e08cae5974a9c587677d7d8e63a36a5ff0 (diff) | |
download | qtlocation-mapboxgl-76ed5079a547e9f98616a9401c8814d224cec9d8.tar.gz |
[core, ios, macos, android] Add data-driven-styling support for `text-font`
Diffstat (limited to 'include/mbgl/style/expression/expression.hpp')
-rw-r--r-- | include/mbgl/style/expression/expression.hpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/include/mbgl/style/expression/expression.hpp b/include/mbgl/style/expression/expression.hpp index a22fc28724..cf9fa0cb21 100644 --- a/include/mbgl/style/expression/expression.hpp +++ b/include/mbgl/style/expression/expression.hpp @@ -1,8 +1,5 @@ #pragma once -#include <array> -#include <vector> -#include <memory> #include <mbgl/util/optional.hpp> #include <mbgl/util/variant.hpp> #include <mbgl/util/color.hpp> @@ -10,6 +7,10 @@ #include <mbgl/style/expression/value.hpp> #include <mbgl/style/expression/parsing_context.hpp> +#include <array> +#include <vector> +#include <memory> + namespace mbgl { class GeometryTileFeature; @@ -38,7 +39,7 @@ public: optional<double> heatmapDensity; }; -template<typename T> +template <typename T> class Result : private variant<EvaluationError, T> { public: using variant<EvaluationError, T>::variant; @@ -128,6 +129,13 @@ public: EvaluationResult evaluate(optional<float> zoom, const Feature& feature, optional<double> heatmapDensity) const; + /** + * Statically analyze the expression, attempting to enumerate possible outputs. Returns + * an array of values plus the sentinel null optional value, used to indicate that the + * complete set of outputs is statically undecidable. + */ + virtual std::vector<optional<Value>> possibleOutputs() const = 0; + protected: template <typename T> static bool childrenEqual(const T& lhs, const T& rhs) { @@ -161,8 +169,6 @@ protected: const std::pair<std::unique_ptr<Expression>, std::unique_ptr<Expression>>& rhs) { return *(lhs.first) == *(rhs.first) && *(lhs.second) == *(rhs.second); } - - private: type::Type type; |