summaryrefslogtreecommitdiff
path: root/include/mbgl
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2018-06-29 14:32:39 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2018-06-29 15:38:11 -0700
commit647959a85327660a8d0b35da0b8a247820a36c15 (patch)
tree75e3b323b96d6bd36b7a351cb04b6f3a565399e4 /include/mbgl
parent25ac89e018a27fc689f742429c78ba492682b0a0 (diff)
downloadqtlocation-mapboxgl-647959a85327660a8d0b35da0b8a247820a36c15.tar.gz
[core] Add assertions to expression constructors
Diffstat (limited to 'include/mbgl')
-rw-r--r--include/mbgl/style/expression/assertion.hpp5
-rw-r--r--include/mbgl/style/expression/interpolate.hpp11
-rw-r--r--include/mbgl/style/expression/step.hpp11
3 files changed, 7 insertions, 20 deletions
diff --git a/include/mbgl/style/expression/assertion.hpp b/include/mbgl/style/expression/assertion.hpp
index d1e919b10f..90da16b068 100644
--- a/include/mbgl/style/expression/assertion.hpp
+++ b/include/mbgl/style/expression/assertion.hpp
@@ -13,10 +13,7 @@ namespace expression {
class Assertion : public Expression {
public:
- Assertion(type::Type type_, std::vector<std::unique_ptr<Expression>> inputs_) :
- Expression(type_),
- inputs(std::move(inputs_))
- {}
+ Assertion(type::Type type_, std::vector<std::unique_ptr<Expression>> inputs_);
static ParseResult parse(const mbgl::style::conversion::Convertible& value, ParsingContext& ctx);
diff --git a/include/mbgl/style/expression/interpolate.hpp b/include/mbgl/style/expression/interpolate.hpp
index 0e7682007f..0aca6909a3 100644
--- a/include/mbgl/style/expression/interpolate.hpp
+++ b/include/mbgl/style/expression/interpolate.hpp
@@ -19,14 +19,9 @@ ParseResult parseInterpolate(const mbgl::style::conversion::Convertible& value,
class Interpolate : public Expression {
public:
Interpolate(const type::Type& type_,
- Interpolator interpolator_,
- std::unique_ptr<Expression> input_,
- std::map<double, std::unique_ptr<Expression>> stops_
- ) : Expression(type_),
- interpolator(std::move(interpolator_)),
- input(std::move(input_)),
- stops(std::move(stops_))
- {}
+ Interpolator interpolator_,
+ std::unique_ptr<Expression> input_,
+ std::map<double, std::unique_ptr<Expression>> stops_);
const std::unique_ptr<Expression>& getInput() const { return input; }
const Interpolator& getInterpolator() const { return interpolator; }
diff --git a/include/mbgl/style/expression/step.hpp b/include/mbgl/style/expression/step.hpp
index 2f9524a53c..24e29b1a4e 100644
--- a/include/mbgl/style/expression/step.hpp
+++ b/include/mbgl/style/expression/step.hpp
@@ -1,4 +1,3 @@
-
#pragma once
#include <mbgl/style/expression/expression.hpp>
@@ -10,7 +9,6 @@
#include <memory>
#include <map>
-
namespace mbgl {
namespace style {
namespace expression {
@@ -18,12 +16,8 @@ namespace expression {
class Step : public Expression {
public:
Step(const type::Type& type_,
- std::unique_ptr<Expression> input_,
- std::map<double, std::unique_ptr<Expression>> stops_
- ) : Expression(type_),
- input(std::move(input_)),
- stops(std::move(stops_))
- {}
+ std::unique_ptr<Expression> input_,
+ std::map<double, std::unique_ptr<Expression>> stops_);
EvaluationResult evaluate(const EvaluationContext& params) const override;
void eachChild(const std::function<void(const Expression&)>& visit) const override;
@@ -40,6 +34,7 @@ public:
mbgl::Value serialize() const override;
std::string getOperator() const override { return "step"; }
+
private:
const std::unique_ptr<Expression> input;
const std::map<double, std::unique_ptr<Expression>> stops;