From 1a66a02097f0e3c95a4d06610fc0b7609f6d77b9 Mon Sep 17 00:00:00 2001 From: Mikhail Pozdnyakov Date: Thu, 24 Jan 2019 10:40:50 +0200 Subject: [core] Introduce `style::LayerProperties` interface and its implementations --- include/mbgl/style/layer_properties.hpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 include/mbgl/style/layer_properties.hpp (limited to 'include/mbgl/style') diff --git a/include/mbgl/style/layer_properties.hpp b/include/mbgl/style/layer_properties.hpp new file mode 100644 index 0000000000..89d599dfbc --- /dev/null +++ b/include/mbgl/style/layer_properties.hpp @@ -0,0 +1,29 @@ +#pragma once +#include + +namespace mbgl { + +namespace style { + +/** + * @brief An interface, wrapping evaluated layer properties. + * + * It is an abstract base class; concrete derived classes that hold the actual data are provided for each layer type. + */ +class LayerProperties { +public: + virtual ~LayerProperties() = default; + + Immutable baseImpl; + +protected: + LayerProperties(Immutable impl) : baseImpl(std::move(impl)) {} +}; + +template +inline const auto& getEvaluated(const Immutable& properties) { + return static_cast(*properties).evaluated; +} + +} // namespace style +} // namespace mbgl -- cgit v1.2.1