Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[core, android, darwin] Move layer factories to separate files
Browse files Browse the repository at this point in the history
  • Loading branch information
pozdnyakov committed Dec 10, 2018
1 parent cbcd087 commit ebd87a5
Show file tree
Hide file tree
Showing 76 changed files with 493 additions and 377 deletions.
20 changes: 20 additions & 0 deletions cmake/core-files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,30 @@ src/mbgl/gl/vertex_array_extension.hpp
src/mbgl/gl/vertex_buffer.hpp

# layermanager
include/mbgl/layermanager/background_layer_factory.hpp
include/mbgl/layermanager/circle_layer_factory.hpp
include/mbgl/layermanager/custom_layer_factory.hpp
include/mbgl/layermanager/fill_extrusion_layer_factory.hpp
include/mbgl/layermanager/fill_layer_factory.hpp
include/mbgl/layermanager/heatmap_layer_factory.hpp
include/mbgl/layermanager/hillshade_layer_factory.hpp
include/mbgl/layermanager/layer_factory.hpp
include/mbgl/layermanager/layer_manager.hpp
include/mbgl/layermanager/line_layer_factory.hpp
include/mbgl/layermanager/raster_layer_factory.hpp
include/mbgl/layermanager/symbol_layer_factory.hpp
src/mbgl/layermanager/background_layer_factory.cpp
src/mbgl/layermanager/circle_layer_factory.cpp
src/mbgl/layermanager/custom_layer_factory.cpp
src/mbgl/layermanager/fill_extrusion_layer_factory.cpp
src/mbgl/layermanager/fill_layer_factory.cpp
src/mbgl/layermanager/heatmap_layer_factory.cpp
src/mbgl/layermanager/hillshade_layer_factory.cpp
src/mbgl/layermanager/layer_factory.cpp
src/mbgl/layermanager/layer_manager.cpp
src/mbgl/layermanager/line_layer_factory.cpp
src/mbgl/layermanager/raster_layer_factory.cpp
src/mbgl/layermanager/symbol_layer_factory.cpp

# layout
src/mbgl/layout/clip_lines.cpp
Expand Down
14 changes: 14 additions & 0 deletions include/mbgl/layermanager/background_layer_factory.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#pragma once

#include <mbgl/layermanager/layer_factory.hpp>

namespace mbgl {

class BackgroundLayerFactory : public LayerFactory {
protected:
const style::LayerTypeInfo* getTypeInfo() const noexcept final;
std::unique_ptr<style::Layer> createLayer(const std::string& id, const style::conversion::Convertible& value) noexcept final;
std::unique_ptr<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final;
};

} // namespace mbgl
14 changes: 14 additions & 0 deletions include/mbgl/layermanager/circle_layer_factory.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#pragma once

#include <mbgl/layermanager/layer_factory.hpp>

namespace mbgl {

class CircleLayerFactory : public LayerFactory {
protected:
const style::LayerTypeInfo* getTypeInfo() const noexcept final;
std::unique_ptr<style::Layer> createLayer(const std::string& id, const style::conversion::Convertible& value) noexcept final;
std::unique_ptr<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final;
};

} // namespace mbgl
17 changes: 17 additions & 0 deletions include/mbgl/layermanager/custom_layer_factory.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#pragma once

#include <mbgl/layermanager/layer_factory.hpp>
#include <mbgl/style/layer.hpp>

#include <array>

namespace mbgl {

class CustomLayerFactory : public LayerFactory {
protected:
const style::LayerTypeInfo* getTypeInfo() const noexcept final;
std::unique_ptr<style::Layer> createLayer(const std::string& id, const style::conversion::Convertible& value) noexcept final;
std::unique_ptr<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final;
};

} // namespace mbgl
14 changes: 14 additions & 0 deletions include/mbgl/layermanager/fill_extrusion_layer_factory.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#pragma once

#include <mbgl/layermanager/layer_factory.hpp>

namespace mbgl {

class FillExtrusionLayerFactory : public LayerFactory {
protected:
const style::LayerTypeInfo* getTypeInfo() const noexcept final;
std::unique_ptr<style::Layer> createLayer(const std::string& id, const style::conversion::Convertible& value) noexcept final;
std::unique_ptr<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final;
};

} // namespace mbgl
14 changes: 14 additions & 0 deletions include/mbgl/layermanager/fill_layer_factory.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#pragma once

#include <mbgl/layermanager/layer_factory.hpp>

namespace mbgl {

class FillLayerFactory : public LayerFactory {
protected:
const style::LayerTypeInfo* getTypeInfo() const noexcept final;
std::unique_ptr<style::Layer> createLayer(const std::string& id, const style::conversion::Convertible& value) noexcept final;
std::unique_ptr<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final;
};

} // namespace mbgl
14 changes: 14 additions & 0 deletions include/mbgl/layermanager/heatmap_layer_factory.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#pragma once

#include <mbgl/layermanager/layer_factory.hpp>

namespace mbgl {

class HeatmapLayerFactory : public LayerFactory {
protected:
const style::LayerTypeInfo* getTypeInfo() const noexcept final;
std::unique_ptr<style::Layer> createLayer(const std::string& id, const style::conversion::Convertible& value) noexcept final;
std::unique_ptr<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final;
};

} // namespace mbgl
14 changes: 14 additions & 0 deletions include/mbgl/layermanager/hillshade_layer_factory.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#pragma once

#include <mbgl/layermanager/layer_factory.hpp>

namespace mbgl {

class HillshadeLayerFactory : public LayerFactory {
protected:
const style::LayerTypeInfo* getTypeInfo() const noexcept final;
std::unique_ptr<style::Layer> createLayer(const std::string& id, const style::conversion::Convertible& value) noexcept final;
std::unique_ptr<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final;
};

} // namespace mbgl
14 changes: 14 additions & 0 deletions include/mbgl/layermanager/line_layer_factory.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#pragma once

#include <mbgl/layermanager/layer_factory.hpp>

namespace mbgl {

class LineLayerFactory : public LayerFactory {
protected:
const style::LayerTypeInfo* getTypeInfo() const noexcept final;
std::unique_ptr<style::Layer> createLayer(const std::string& id, const style::conversion::Convertible& value) noexcept final;
std::unique_ptr<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final;
};

} // namespace mbgl
14 changes: 14 additions & 0 deletions include/mbgl/layermanager/raster_layer_factory.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#pragma once

#include <mbgl/layermanager/layer_factory.hpp>

namespace mbgl {

class RasterLayerFactory : public LayerFactory {
protected:
const style::LayerTypeInfo* getTypeInfo() const noexcept final;
std::unique_ptr<style::Layer> createLayer(const std::string& id, const style::conversion::Convertible& value) noexcept final;
std::unique_ptr<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final;
};

} // namespace mbgl
14 changes: 14 additions & 0 deletions include/mbgl/layermanager/symbol_layer_factory.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#pragma once

#include <mbgl/layermanager/layer_factory.hpp>

namespace mbgl {

class SymbolLayerFactory : public LayerFactory {
protected:
const style::LayerTypeInfo* getTypeInfo() const noexcept final;
std::unique_ptr<style::Layer> createLayer(const std::string& id, const style::conversion::Convertible& value) noexcept final;
std::unique_ptr<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final;
};

} // namespace mbgl
9 changes: 0 additions & 9 deletions include/mbgl/style/layers/background_layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#pragma once

#include <mbgl/layermanager/layer_factory.hpp>
#include <mbgl/style/layer.hpp>
#include <mbgl/style/filter.hpp>
#include <mbgl/style/property_value.hpp>
Expand Down Expand Up @@ -57,12 +56,4 @@ class BackgroundLayer : public Layer {
};

} // namespace style

class BackgroundLayerFactory : public LayerFactory {
protected:
const style::LayerTypeInfo* getTypeInfo() const noexcept final;
std::unique_ptr<style::Layer> createLayer(const std::string& id, const style::conversion::Convertible& value) noexcept final;
std::unique_ptr<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final;
};

} // namespace mbgl
9 changes: 0 additions & 9 deletions include/mbgl/style/layers/circle_layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#pragma once

#include <mbgl/layermanager/layer_factory.hpp>
#include <mbgl/style/layer.hpp>
#include <mbgl/style/filter.hpp>
#include <mbgl/style/property_value.hpp>
Expand Down Expand Up @@ -105,12 +104,4 @@ class CircleLayer : public Layer {
};

} // namespace style

class CircleLayerFactory : public LayerFactory {
protected:
const style::LayerTypeInfo* getTypeInfo() const noexcept final;
std::unique_ptr<style::Layer> createLayer(const std::string& id, const style::conversion::Convertible& value) noexcept final;
std::unique_ptr<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final;
};

} // namespace mbgl
9 changes: 0 additions & 9 deletions include/mbgl/style/layers/custom_layer.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#pragma once

#include <mbgl/layermanager/layer_factory.hpp>
#include <mbgl/style/layer.hpp>

#include <array>
Expand Down Expand Up @@ -87,12 +86,4 @@ class CustomLayer : public Layer {
};

} // namespace style

class CustomLayerFactory : public LayerFactory {
// LayerFactory overrides.
const style::LayerTypeInfo* getTypeInfo() const noexcept final;
std::unique_ptr<style::Layer> createLayer(const std::string& id, const style::conversion::Convertible& value) noexcept final;
std::unique_ptr<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final;
};

} // namespace mbgl
9 changes: 0 additions & 9 deletions include/mbgl/style/layers/fill_extrusion_layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#pragma once

#include <mbgl/layermanager/layer_factory.hpp>
#include <mbgl/style/layer.hpp>
#include <mbgl/style/filter.hpp>
#include <mbgl/style/property_value.hpp>
Expand Down Expand Up @@ -87,12 +86,4 @@ class FillExtrusionLayer : public Layer {
};

} // namespace style

class FillExtrusionLayerFactory : public LayerFactory {
protected:
const style::LayerTypeInfo* getTypeInfo() const noexcept final;
std::unique_ptr<style::Layer> createLayer(const std::string& id, const style::conversion::Convertible& value) noexcept final;
std::unique_ptr<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final;
};

} // namespace mbgl
9 changes: 0 additions & 9 deletions include/mbgl/style/layers/fill_layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#pragma once

#include <mbgl/layermanager/layer_factory.hpp>
#include <mbgl/style/layer.hpp>
#include <mbgl/style/filter.hpp>
#include <mbgl/style/property_value.hpp>
Expand Down Expand Up @@ -81,12 +80,4 @@ class FillLayer : public Layer {
};

} // namespace style

class FillLayerFactory : public LayerFactory {
protected:
const style::LayerTypeInfo* getTypeInfo() const noexcept final;
std::unique_ptr<style::Layer> createLayer(const std::string& id, const style::conversion::Convertible& value) noexcept final;
std::unique_ptr<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final;
};

} // namespace mbgl
9 changes: 0 additions & 9 deletions include/mbgl/style/layers/heatmap_layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#pragma once

#include <mbgl/layermanager/layer_factory.hpp>
#include <mbgl/style/color_ramp_property_value.hpp>
#include <mbgl/style/layer.hpp>
#include <mbgl/style/filter.hpp>
Expand Down Expand Up @@ -70,12 +69,4 @@ class HeatmapLayer : public Layer {
};

} // namespace style

class HeatmapLayerFactory : public LayerFactory {
protected:
const style::LayerTypeInfo* getTypeInfo() const noexcept final;
std::unique_ptr<style::Layer> createLayer(const std::string& id, const style::conversion::Convertible& value) noexcept final;
std::unique_ptr<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final;
};

} // namespace mbgl
9 changes: 0 additions & 9 deletions include/mbgl/style/layers/hillshade_layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#pragma once

#include <mbgl/layermanager/layer_factory.hpp>
#include <mbgl/style/layer.hpp>
#include <mbgl/style/filter.hpp>
#include <mbgl/style/property_value.hpp>
Expand Down Expand Up @@ -75,12 +74,4 @@ class HillshadeLayer : public Layer {
};

} // namespace style

class HillshadeLayerFactory : public LayerFactory {
protected:
const style::LayerTypeInfo* getTypeInfo() const noexcept final;
std::unique_ptr<style::Layer> createLayer(const std::string& id, const style::conversion::Convertible& value) noexcept final;
std::unique_ptr<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final;
};

} // namespace mbgl
9 changes: 0 additions & 9 deletions include/mbgl/style/layers/layer.hpp.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#pragma once

#include <mbgl/layermanager/layer_factory.hpp>
<% if (type === 'heatmap' || type === 'line') { -%>
#include <mbgl/style/color_ramp_property_value.hpp>
<% } -%>
Expand Down Expand Up @@ -73,12 +72,4 @@ protected:
};
} // namespace style
class <%- camelize(type) %>LayerFactory : public LayerFactory {
protected:
const style::LayerTypeInfo* getTypeInfo() const noexcept final;
std::unique_ptr<style::Layer> createLayer(const std::string& id, const style::conversion::Convertible& value) noexcept final;
std::unique_ptr<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final;
};
} // namespace mbgl
9 changes: 0 additions & 9 deletions include/mbgl/style/layers/line_layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#pragma once

#include <mbgl/layermanager/layer_factory.hpp>
#include <mbgl/style/color_ramp_property_value.hpp>
#include <mbgl/style/layer.hpp>
#include <mbgl/style/filter.hpp>
Expand Down Expand Up @@ -126,12 +125,4 @@ class LineLayer : public Layer {
};

} // namespace style

class LineLayerFactory : public LayerFactory {
protected:
const style::LayerTypeInfo* getTypeInfo() const noexcept final;
std::unique_ptr<style::Layer> createLayer(const std::string& id, const style::conversion::Convertible& value) noexcept final;
std::unique_ptr<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final;
};

} // namespace mbgl
9 changes: 0 additions & 9 deletions include/mbgl/style/layers/raster_layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#pragma once

#include <mbgl/layermanager/layer_factory.hpp>
#include <mbgl/style/layer.hpp>
#include <mbgl/style/filter.hpp>
#include <mbgl/style/property_value.hpp>
Expand Down Expand Up @@ -87,12 +86,4 @@ class RasterLayer : public Layer {
};

} // namespace style

class RasterLayerFactory : public LayerFactory {
protected:
const style::LayerTypeInfo* getTypeInfo() const noexcept final;
std::unique_ptr<style::Layer> createLayer(const std::string& id, const style::conversion::Convertible& value) noexcept final;
std::unique_ptr<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept final;
};

} // namespace mbgl
Loading

0 comments on commit ebd87a5

Please sign in to comment.