Create SharedSQLiteCache
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user