1 #pragma once 2 3 #include <mbgl/style/expression/expression.hpp> 4 #include <mbgl/style/conversion.hpp> 5 6 #include <memory> 7 8 namespace mbgl { 9 namespace style { 10 namespace expression { 11 12 class Any : public Expression { 13 public: Any(std::vector<std::unique_ptr<Expression>> inputs_)14 Any(std::vector<std::unique_ptr<Expression>> inputs_) : 15 Expression(Kind::Any, type::Boolean), 16 inputs(std::move(inputs_)) 17 {} 18 19 static ParseResult parse(const mbgl::style::conversion::Convertible& value, ParsingContext& ctx); 20 21 EvaluationResult evaluate(const EvaluationContext& params) const override; 22 void eachChild(const std::function<void(const Expression&)>& visit) const override; 23 bool operator==(const Expression& e) const override; 24 std::vector<optional<Value>> possibleOutputs() const override; 25 getOperator() const26 std::string getOperator() const override { return "any"; } 27 private: 28 std::vector<std::unique_ptr<Expression>> inputs; 29 }; 30 31 class All : public Expression { 32 public: All(std::vector<std::unique_ptr<Expression>> inputs_)33 All(std::vector<std::unique_ptr<Expression>> inputs_) : 34 Expression(Kind::All, type::Boolean), 35 inputs(std::move(inputs_)) 36 {} 37 38 static ParseResult parse(const mbgl::style::conversion::Convertible& value, ParsingContext& ctx); 39 40 EvaluationResult evaluate(const EvaluationContext& params) const override; 41 void eachChild(const std::function<void(const Expression&)>& visit) const override; 42 bool operator==(const Expression& e) const override; 43 std::vector<optional<Value>> possibleOutputs() const override; 44 getOperator() const45 std::string getOperator() const override { return "all"; } 46 private: 47 std::vector<std::unique_ptr<Expression>> inputs; 48 }; 49 50 } // namespace expression 51 } // namespace style 52 } // namespace mbgl 53