MapLibre Native Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
layer_manager.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <mbgl/style/layer.hpp>
4 
5 #include <vector>
6 
7 namespace mbgl {
8 namespace style {
9 class LayerProperties;
10 } // namespace style
11 class GeometryTileLayer;
12 class LayerFactory;
13 class RenderLayer;
14 class Bucket;
15 class BucketParameters;
16 class Layout;
17 class LayoutParameters;
18 
28 class LayerManager {
29 public:
35  static LayerManager* get() noexcept;
36 
38  std::unique_ptr<style::Layer> createLayer(const std::string& type, const std::string& id,
39  const style::conversion::Convertible& value, style::conversion::Error& error) noexcept;
41  std::unique_ptr<RenderLayer> createRenderLayer(Immutable<style::Layer::Impl>) noexcept;
43  std::unique_ptr<Bucket> createBucket(const BucketParameters&, const std::vector<Immutable<style::LayerProperties>>&) noexcept;
45  std::unique_ptr<Layout> createLayout(const LayoutParameters&, std::unique_ptr<GeometryTileLayer>,
46  const std::vector<Immutable<style::LayerProperties>>&) noexcept;
47 
62  static const bool annotationsEnabled;
63 
64 protected:
65  virtual ~LayerManager() = default;
66  virtual LayerFactory* getFactory(const std::string& type) noexcept = 0;
67  virtual LayerFactory* getFactory(const style::LayerTypeInfo*) noexcept = 0;
68 };
69 
70 } // namespace mbgl
The LayerFactory abstract class.
A singleton class responsible for creating layer instances.
static const bool annotationsEnabled
a build-time flag to enable/disable annotations in mapbox-gl-native core.
std::unique_ptr< style::Layer > createLayer(const std::string &type, const std::string &id, const style::conversion::Convertible &value, style::conversion::Error &error) noexcept
Returns a new Layer instance on success call; returns nullptr otherwise.
std::unique_ptr< RenderLayer > createRenderLayer(Immutable< style::Layer::Impl >) noexcept
Returns a new RenderLayer instance on success call; returns nullptr otherwise.
std::unique_ptr< Layout > createLayout(const LayoutParameters &, std::unique_ptr< GeometryTileLayer >, const std::vector< Immutable< style::LayerProperties >> &) noexcept
Returns a new Layout instance on success call; returns nullptr otherwise.
std::unique_ptr< Bucket > createBucket(const BucketParameters &, const std::vector< Immutable< style::LayerProperties >> &) noexcept
Returns a new Bucket instance on success call; returns nullptr otherwise.
virtual LayerFactory * getFactory(const std::string &type) noexcept=0
static LayerManager * get() noexcept
A singleton getter.
std::unique_ptr< Expression > error(std::string)
Definition: actor.hpp:15
Definition: tile_id.hpp:256