summaryrefslogtreecommitdiff
path: root/include/mbgl/style/expression/compound_expression.hpp
diff options
context:
space:
mode:
authorLucas Wojciechowski <hello@lucaswoj.com>2018-05-10 12:37:14 -0700
committerAsheem Mamoowala <asheem.mamoowala@mapbox.com>2018-05-10 12:37:14 -0700
commita4e2c1af1fd83b22ef4ee57ab19a15616224f8b8 (patch)
tree7584634fd01753452d28ea30cdc63e98c8618d43 /include/mbgl/style/expression/compound_expression.hpp
parentee1008870284d2956c4d246bd8751e032ee91898 (diff)
downloadqtlocation-mapboxgl-a4e2c1af1fd83b22ef4ee57ab19a15616224f8b8.tar.gz
[core] Convert "legacy" filters directly into expressions (#11610)
Ports the specialized filter-* expressions from GL JS, adding them to src/mbgl/style/expression/compound_expression.cpp
Diffstat (limited to 'include/mbgl/style/expression/compound_expression.hpp')
-rw-r--r--include/mbgl/style/expression/compound_expression.hpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/include/mbgl/style/expression/compound_expression.hpp b/include/mbgl/style/expression/compound_expression.hpp
index 6baaae862f..431afb4d13 100644
--- a/include/mbgl/style/expression/compound_expression.hpp
+++ b/include/mbgl/style/expression/compound_expression.hpp
@@ -36,7 +36,7 @@ template <typename T>
struct Varargs : std::vector<T> { using std::vector<T>::vector; };
namespace detail {
-// Base class for the Signature<Fn> structs that are used to determine the
+// Base class for the Signature<Fn> structs that are used to determine
// each CompoundExpression definition's type::Type data from the type of its
// "evaluate" function.
struct SignatureBase {
@@ -137,10 +137,21 @@ ParseResult parseCompoundExpression(const std::string name, const mbgl::style::c
ParseResult createCompoundExpression(const CompoundExpressionRegistry::Definition& definition,
std::vector<std::unique_ptr<Expression>> args,
ParsingContext& ctx);
-
+
ParseResult createCompoundExpression(const std::string& name,
std::vector<std::unique_ptr<Expression>> args,
ParsingContext& ctx);
+// Convenience method for use expressions that have 0, 1, or 2 args.
+ParseResult createCompoundExpression(const std::string& name, ParsingContext& ctx);
+
+ParseResult createCompoundExpression(const std::string& name,
+ std::unique_ptr<Expression> arg1,
+ ParsingContext& ctx);
+
+ParseResult createCompoundExpression(const std::string& name,
+ std::unique_ptr<Expression> arg1,
+ std::unique_ptr<Expression> arg2,
+ ParsingContext& ctx);
} // namespace expression
} // namespace style