#pragma once #include #include #include #include #include #include #include #include namespace mbgl { namespace style { namespace expression { namespace detail { struct SignatureBase; } // namespace detail /* CompoundExpression provides a mechanism for implementing an expression simply by providing a list of pure functions of the form (const T0& arg0, const T1& arg1, ...) -> Result where T0, T1, ..., U are member types of mbgl::style::expression::Value. The majority of expressions specified in the style-spec are implemented in this fashion (see compound_expression.cpp). */ class CompoundExpression : public Expression { public: CompoundExpression(const detail::SignatureBase&, std::vector>); std::string getOperator() const override; EvaluationResult evaluate(const EvaluationContext& evaluationParams) const override; std::vector> possibleOutputs() const override; void eachChild(const std::function& visit) const override; bool operator==(const Expression& e) const override; optional getParameterCount() const; static bool exists(const std::string& name); protected: const detail::SignatureBase& signature; std::vector> args; }; ParseResult parseCompoundExpression(const std::string& name, const mbgl::style::conversion::Convertible& value, ParsingContext& ctx); ParseResult createCompoundExpression(const std::string& name, std::vector> args, ParsingContext& ctx); } // namespace expression } // namespace style } // namespace mbgl