summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-06-08 17:18:06 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-06-13 17:22:05 -0700
commit039b05ebb462762c43ce4fc750fd98ae0c9e0093 (patch)
treeb424a42325ad306593d85ea438bee0d22d67ea30 /include
parentee78b1b797bc8d46f7475612ae84f0ee548a0ed6 (diff)
downloadqtlocation-mapboxgl-039b05ebb462762c43ce4fc750fd98ae0c9e0093.tar.gz
[core] Extract code templates to individual .ejs files
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/style/layers/layer.hpp.ejs76
1 files changed, 76 insertions, 0 deletions
diff --git a/include/mbgl/style/layers/layer.hpp.ejs b/include/mbgl/style/layers/layer.hpp.ejs
new file mode 100644
index 0000000000..fdf7620892
--- /dev/null
+++ b/include/mbgl/style/layers/layer.hpp.ejs
@@ -0,0 +1,76 @@
+<%
+ const type = locals.type;
+ const layoutProperties = locals.layoutProperties;
+ const paintProperties = locals.paintProperties;
+-%>
+// This file is generated. Do not edit.
+
+#pragma once
+
+#include <mbgl/style/layer.hpp>
+#include <mbgl/style/filter.hpp>
+#include <mbgl/style/property_value.hpp>
+
+#include <mbgl/util/color.hpp>
+
+<% if (type === 'line' || type === 'symbol') { -%>
+#include <vector>
+
+<% } -%>
+namespace mbgl {
+namespace style {
+
+class <%- camelize(type) %>Layer : public Layer {
+public:
+ <%- camelize(type) %>Layer(const std::string& layerID);
+ ~<%- camelize(type) %>Layer() final;
+
+<% if (type === 'raster') { -%>
+ // Source
+
+ void setSource(const std::string& sourceID);
+ const std::string& getSourceID() const;
+
+<% } else if (type !== 'background') { -%>
+ // Source
+
+ void setSource(const std::string& sourceID, const std::string& sourceLayer);
+ const std::string& getSourceID() const;
+ const std::string& getSourceLayer() const;
+
+ void setFilter(const Filter&);
+ const Filter& getFilter() const;
+
+<% } -%>
+<% if (layoutProperties.length) { -%>
+ // Layout properties
+
+<% for (const property of layoutProperties) { -%>
+ PropertyValue<<%- propertyType(property) %>> get<%- camelize(property.name) %>() const;
+ void set<%- camelize(property.name) %>(PropertyValue<<%- propertyType(property) %>>);
+
+<% } -%>
+<% } -%>
+ // Paint properties
+
+<% for (const property of paintProperties) { -%>
+ PropertyValue<<%- propertyType(property) %>> get<%- camelize(property.name) %>() const;
+ void set<%- camelize(property.name) %>(PropertyValue<<%- propertyType(property) %>>);
+
+<% } -%>
+ // Private implementation
+
+ class Impl;
+ Impl* const impl;
+
+ <%- camelize(type) %>Layer(const Impl&);
+ <%- camelize(type) %>Layer(const <%- camelize(type) %>Layer&) = delete;
+};
+
+template <>
+inline bool Layer::is<<%- camelize(type) %>Layer>() const {
+ return type == Type::<%- camelize(type) %>;
+}
+
+} // namespace style
+} // namespace mbgl