summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-12-12 14:49:11 +0200
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-12-13 15:34:06 +0200
commit9901167936fa8fe13fa0f93a0604e86fc15b71cd (patch)
tree5d8d4568bfe8c50d93193bc07d341d7aa2e98122
parent426f714c04f563c892f35e0f5dfd97137dc977d9 (diff)
downloadqtlocation-mapboxgl-9901167936fa8fe13fa0f93a0604e86fc15b71cd.tar.gz
[core] Add style::Layer(Impl) constructor
-rw-r--r--include/mbgl/style/light.hpp1
-rw-r--r--include/mbgl/style/light.hpp.ejs1
-rw-r--r--src/mbgl/style/light.cpp7
-rw-r--r--src/mbgl/style/light.cpp.ejs7
4 files changed, 8 insertions, 8 deletions
diff --git a/include/mbgl/style/light.hpp b/include/mbgl/style/light.hpp
index 7434fb2882..dc54f98075 100644
--- a/include/mbgl/style/light.hpp
+++ b/include/mbgl/style/light.hpp
@@ -51,6 +51,7 @@ public:
class Impl;
Immutable<Impl> impl;
+ explicit Light(Immutable<Impl>);
Mutable<Impl> mutableImpl() const;
LightObserver* observer = nullptr;
diff --git a/include/mbgl/style/light.hpp.ejs b/include/mbgl/style/light.hpp.ejs
index e4661dc59b..071647965d 100644
--- a/include/mbgl/style/light.hpp.ejs
+++ b/include/mbgl/style/light.hpp.ejs
@@ -38,6 +38,7 @@ public:
<% } -%>
class Impl;
Immutable<Impl> impl;
+ explicit Light(Immutable<Impl>);
Mutable<Impl> mutableImpl() const;
LightObserver* observer = nullptr;
diff --git a/src/mbgl/style/light.cpp b/src/mbgl/style/light.cpp
index a10e693073..2ef4c2f940 100644
--- a/src/mbgl/style/light.cpp
+++ b/src/mbgl/style/light.cpp
@@ -17,10 +17,9 @@ namespace style {
static LightObserver nullObserver;
-Light::Light()
- : impl(makeMutable<Impl>()),
- observer(&nullObserver) {
-}
+Light::Light(Immutable<Light::Impl> impl_) : impl(std::move(impl_)), observer(&nullObserver) {}
+
+Light::Light() : Light(makeMutable<Impl>()) {}
Light::~Light() = default;
diff --git a/src/mbgl/style/light.cpp.ejs b/src/mbgl/style/light.cpp.ejs
index 68c1bf59e2..9f84238839 100644
--- a/src/mbgl/style/light.cpp.ejs
+++ b/src/mbgl/style/light.cpp.ejs
@@ -20,10 +20,9 @@ namespace style {
static LightObserver nullObserver;
-Light::Light()
- : impl(makeMutable<Impl>()),
- observer(&nullObserver) {
-}
+Light::Light(Immutable<Light::Impl> impl_) : impl(std::move(impl_)), observer(&nullObserver) {}
+
+Light::Light() : Light(makeMutable<Impl>()) {}
Light::~Light() = default;