1#pragma once
2
3#include <mbgl/style/expression/value.hpp>
4#include <mbgl/style/expression/expression.hpp>
5#include <mbgl/style/expression/interpolator.hpp>
6#include <mbgl/util/ignore.hpp>
7
8#include <memory>
9#include <string>
10#include <initializer_list>
11
12namespace mbgl {
13namespace style {
14namespace expression {
15namespace dsl {
16
17// This convenience API does little to no expression validation or type-checking, and is intended for
18// use only by test and other non-production code.
19
20template <class... Args>
21std::vector<std::unique_ptr<Expression>> vec(Args... args) {
22 std::vector<std::unique_ptr<Expression>> result;
23 util::ignore({ (result.push_back(std::move(args)), 0)... });
24 return result;
25}
26
27std::unique_ptr<Expression> error(std::string);
28
29std::unique_ptr<Expression> literal(const char* value);
30std::unique_ptr<Expression> literal(Value value);
31std::unique_ptr<Expression> literal(std::initializer_list<double> value);
32std::unique_ptr<Expression> literal(std::initializer_list<const char *> value);
33
34std::unique_ptr<Expression> number(std::unique_ptr<Expression>);
35std::unique_ptr<Expression> string(std::unique_ptr<Expression>);
36std::unique_ptr<Expression> boolean(std::unique_ptr<Expression>);
37
38std::unique_ptr<Expression> toColor(std::unique_ptr<Expression>);
39std::unique_ptr<Expression> toString(std::unique_ptr<Expression>);
40
41std::unique_ptr<Expression> get(const char* value);
42std::unique_ptr<Expression> get(std::unique_ptr<Expression>);
43
44std::unique_ptr<Expression> id();
45std::unique_ptr<Expression> zoom();
46
47std::unique_ptr<Expression> eq(std::unique_ptr<Expression>,
48 std::unique_ptr<Expression>);
49std::unique_ptr<Expression> ne(std::unique_ptr<Expression>,
50 std::unique_ptr<Expression>);
51std::unique_ptr<Expression> gt(std::unique_ptr<Expression>,
52 std::unique_ptr<Expression>);
53std::unique_ptr<Expression> lt(std::unique_ptr<Expression>,
54 std::unique_ptr<Expression>);
55
56std::unique_ptr<Expression> step(std::unique_ptr<Expression> input,
57 std::unique_ptr<Expression> output0,
58 double input1, std::unique_ptr<Expression> output1);
59
60Interpolator linear();
61Interpolator exponential(double base);
62Interpolator cubicBezier(double x1, double y1, double x2, double y2);
63
64std::unique_ptr<Expression> interpolate(Interpolator interpolator,
65 std::unique_ptr<Expression> input,
66 double input1, std::unique_ptr<Expression> output1);
67
68std::unique_ptr<Expression> interpolate(Interpolator interpolator,
69 std::unique_ptr<Expression> input,
70 double input1, std::unique_ptr<Expression> output1,
71 double input2, std::unique_ptr<Expression> output2);
72
73std::unique_ptr<Expression> interpolate(Interpolator interpolator,
74 std::unique_ptr<Expression> input,
75 double input1, std::unique_ptr<Expression> output1,
76 double input2, std::unique_ptr<Expression> output2,
77 double input3, std::unique_ptr<Expression> output3);
78
79std::unique_ptr<Expression> concat(std::vector<std::unique_ptr<Expression>> inputs);
80
81} // namespace dsl
82} // namespace expression
83} // namespace style
84} // namespace mbgl
85

source code of qtlocation/src/3rdparty/mapbox-gl-native/include/mbgl/style/expression/dsl.hpp