summaryrefslogtreecommitdiff
path: root/src/mbgl/style/layers/layer_properties.cpp.ejs
blob: 2c8e1ce9a0815d58c5962a9d360258481b5f7cf3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<%
  const type = locals.type;
  const layoutProperties = locals.layoutProperties;
  const paintProperties = locals.paintProperties;
-%>
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.

#include <mbgl/style/layers/<%- type.replace('-', '_') %>_layer_properties.hpp>

#include <mbgl/style/layers/<%- type.replace('-', '_') %>_layer_impl.hpp>

namespace mbgl {
namespace style {

<%- camelize(type) %>LayerProperties::<%- camelize(type) %>LayerProperties(
    Immutable<<%- camelize(type) %>Layer::Impl> impl_)
    : LayerProperties(std::move(impl_)) {}

<%- camelize(type) %>LayerProperties::<%- camelize(type) %>LayerProperties(
    Immutable<<%- camelize(type) %>Layer::Impl> impl_,
<% if (type === 'background' || type === 'fill' || type === 'line' || type === 'fill-extrusion') { -%>
    CrossfadeParameters crossfade_,
<% } -%>
    <%- camelize(type) %>PaintProperties::PossiblyEvaluated evaluated_)
  : LayerProperties(std::move(impl_)),
<% if (type === 'background' || type === 'fill' || type === 'line' || type === 'fill-extrusion') { -%>
    crossfade(std::move(crossfade_)),
<% } -%>
    evaluated(std::move(evaluated_)) {}

<%- camelize(type) %>LayerProperties::~<%- camelize(type) %>LayerProperties() = default;

const <%- camelize(type) %>Layer::Impl& <%- camelize(type) %>LayerProperties::layerImpl() const {
    return static_cast<const <%- camelize(type) %>Layer::Impl&>(*baseImpl);
}

} // namespace style
} // namespace mbgl