MapLibre Native Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
compound_expression.hpp
Go to the documentation of this file.
1 #pragma once
2 
8 
9 #include <memory>
10 #include <vector>
11 #include <optional>
12 
13 namespace mbgl {
14 namespace style {
15 namespace expression {
16 
17 namespace detail {
18 struct SignatureBase;
19 } // namespace detail
20 
31 public:
32  CompoundExpression(const detail::SignatureBase&, std::vector<std::unique_ptr<Expression>>);
33 
34  std::string getOperator() const override;
35  EvaluationResult evaluate(const EvaluationContext& evaluationParams) const override;
36  std::vector<std::optional<Value>> possibleOutputs() const override;
37  void eachChild(const std::function<void(const Expression&)>& visit) const override;
38  bool operator==(const Expression& e) const override;
39 
40  std::optional<std::size_t> getParameterCount() const;
41 
42  static bool exists(const std::string& name);
43 
44 protected:
45  const detail::SignatureBase& signature;
46  std::vector<std::unique_ptr<Expression>> args;
47 };
48 
51  ParsingContext& ctx);
52 
54  std::vector<std::unique_ptr<Expression>> args,
55  ParsingContext& ctx);
56 
57 } // namespace expression
58 } // namespace style
59 } // namespace mbgl
EvaluationResult evaluate(const EvaluationContext &evaluationParams) const override
void eachChild(const std::function< void(const Expression &)> &visit) const override
std::vector< std::optional< Value > > possibleOutputs() const override
static bool exists(const std::string &name)
CompoundExpression(const detail::SignatureBase &, std::vector< std::unique_ptr< Expression >>)
std::string getOperator() const override
std::vector< std::unique_ptr< Expression > > args
bool operator==(const Expression &e) const override
std::optional< std::size_t > getParameterCount() const
std::unique_ptr< Expression > string(std::unique_ptr< Expression >, std::unique_ptr< Expression > def=nullptr)
std::optional< std::unique_ptr< Expression > > ParseResult
ParseResult parseCompoundExpression(const std::string &name, const mbgl::style::conversion::Convertible &value, ParsingContext &ctx)
ParseResult createCompoundExpression(const std::string &name, std::vector< std::unique_ptr< Expression >> args, ParsingContext &ctx)
Definition: actor.hpp:15