summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLeith Bade <leith@mapbox.com>2015-09-16 12:45:46 +1000
committerLeith Bade <leith@mapbox.com>2015-09-16 12:45:46 +1000
commit529a7cc93c7819c62d81bd825e8682cf3f93b495 (patch)
tree0e9fab0ff96f75e6f709baa8e38ae6fe6cc844e0 /include
parent765f884ac96c149af3c8e7c11f011bfe9c51b6eb (diff)
downloadqtlocation-mapboxgl-529a7cc93c7819c62d81bd825e8682cf3f93b495.tar.gz
Create SharedSQLiteCache
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/android/native_map_view.hpp2
-rw-r--r--include/mbgl/storage/sqlite_cache.hpp10
2 files changed, 11 insertions, 1 deletions
diff --git a/include/mbgl/android/native_map_view.hpp b/include/mbgl/android/native_map_view.hpp
index d5606ae37f..4033c628b0 100644
--- a/include/mbgl/android/native_map_view.hpp
+++ b/include/mbgl/android/native_map_view.hpp
@@ -90,7 +90,7 @@ private:
size_t totalMemory = 0;
// Ensure these are initialised last
- mbgl::SQLiteCache fileCache;
+ std::shared_ptr<mbgl::SQLiteCache> fileCache;
mbgl::DefaultFileSource fileSource;
mbgl::Map map;
diff --git a/include/mbgl/storage/sqlite_cache.hpp b/include/mbgl/storage/sqlite_cache.hpp
index 65328652f4..3054b6c73c 100644
--- a/include/mbgl/storage/sqlite_cache.hpp
+++ b/include/mbgl/storage/sqlite_cache.hpp
@@ -26,6 +26,16 @@ private:
const std::unique_ptr<util::Thread<Impl>> thread;
};
+class SharedSQLiteCache : util::noncopyable {
+public:
+ static std::shared_ptr<SQLiteCache> get(const std::string &path = ":memory:");
+
+private:
+ SharedSQLiteCache() {}
+
+ static std::weak_ptr<SQLiteCache> masterPtr;
+};
+
}
#endif