summaryrefslogtreecommitdiff
path: root/include/mbgl/map
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-02-17 10:57:21 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-02-20 12:04:21 -0800
commit694159c49ebc15e0d6e92addc31f65b623dbe1f9 (patch)
treea98305c85769b4ff16fdf441adeb337e91780bc0 /include/mbgl/map
parent3ef9e26593bfda1f32bc15d29016d9bb83acb67c (diff)
downloadqtlocation-mapboxgl-694159c49ebc15e0d6e92addc31f65b623dbe1f9.tar.gz
[core] Nestable BackendScope
Diffstat (limited to 'include/mbgl/map')
-rw-r--r--include/mbgl/map/backend.hpp14
-rw-r--r--include/mbgl/map/backend_scope.hpp17
2 files changed, 17 insertions, 14 deletions
diff --git a/include/mbgl/map/backend.hpp b/include/mbgl/map/backend.hpp
index 0468449155..a7c78cf03d 100644
--- a/include/mbgl/map/backend.hpp
+++ b/include/mbgl/map/backend.hpp
@@ -47,18 +47,4 @@ private:
friend class BackendScope;
};
-class BackendScope {
-public:
- BackendScope(Backend& backend_) : backend(backend_) {
- backend.activate();
- }
-
- ~BackendScope() {
- backend.deactivate();
- }
-
-private:
- Backend& backend;
-};
-
} // namespace mbgl
diff --git a/include/mbgl/map/backend_scope.hpp b/include/mbgl/map/backend_scope.hpp
new file mode 100644
index 0000000000..c13fb88ded
--- /dev/null
+++ b/include/mbgl/map/backend_scope.hpp
@@ -0,0 +1,17 @@
+#pragma once
+
+namespace mbgl {
+
+class Backend;
+
+class BackendScope {
+public:
+ BackendScope(Backend&);
+ ~BackendScope();
+
+private:
+ Backend* priorBackend;
+ Backend& backend;
+};
+
+} // namespace mbgl