MapLibre Native Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
length.hpp
Go to the documentation of this file.
1 #pragma once
2 
6 
7 #include <memory>
8 #include <vector>
9 
10 namespace mbgl {
11 namespace style {
12 namespace expression {
13 
14 class Length : public Expression {
15 public:
16  Length(std::unique_ptr<Expression> input);
17 
19 
20  EvaluationResult evaluate(const EvaluationContext& params) const override;
21  void eachChild(const std::function<void(const Expression&)>& visit) const override;
22  bool operator==(const Expression& e) const override;
23  std::vector<std::optional<Value>> possibleOutputs() const override;
24  std::string getOperator() const override { return "length"; }
25 
26 private:
27  std::unique_ptr<Expression> input;
28 };
29 
30 } // namespace expression
31 } // namespace style
32 } // namespace mbgl
void eachChild(const std::function< void(const Expression &)> &visit) const override
static ParseResult parse(const mbgl::style::conversion::Convertible &value, ParsingContext &ctx)
EvaluationResult evaluate(const EvaluationContext &params) const override
std::vector< std::optional< Value > > possibleOutputs() const override
std::string getOperator() const override
Definition: length.hpp:24
bool operator==(const Expression &e) const override
Length(std::unique_ptr< Expression > input)
std::unique_ptr< Expression > string(std::unique_ptr< Expression >, std::unique_ptr< Expression > def=nullptr)
std::optional< std::unique_ptr< Expression > > ParseResult
Definition: actor.hpp:15