diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-01-26 12:19:04 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-02-10 15:40:20 -0800 |
commit | cdedb66387065680efd318dacb61572c920b81b1 (patch) | |
tree | 3cc2676e15fac4c7b024cd17603c46e341f5a589 /src/mbgl/storage | |
parent | 025375ad0b365a06e0742b92fecc9bc538b5a6e0 (diff) | |
download | qtlocation-mapboxgl-cdedb66387065680efd318dacb61572c920b81b1.tar.gz |
[core] Reimplement existing caching within an offline-capable database schema
Diffstat (limited to 'src/mbgl/storage')
-rw-r--r-- | src/mbgl/storage/sqlite_cache.hpp | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/src/mbgl/storage/sqlite_cache.hpp b/src/mbgl/storage/sqlite_cache.hpp deleted file mode 100644 index b5a7cbcc07..0000000000 --- a/src/mbgl/storage/sqlite_cache.hpp +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef MBGL_STORAGE_DEFAULT_SQLITE_CACHE -#define MBGL_STORAGE_DEFAULT_SQLITE_CACHE - -#include <mbgl/util/noncopyable.hpp> -#include <mbgl/util/chrono.hpp> - -#include <functional> -#include <memory> -#include <string> - -namespace mbgl { - -class Resource; -class Response; -class WorkRequest; - -namespace util { -template <typename T> class Thread; -} // namespace util - -class SQLiteCache : private util::noncopyable { -public: - static std::shared_ptr<SQLiteCache> getShared(const std::string &path = ":memory:"); - - SQLiteCache(const std::string &path = ":memory:"); - ~SQLiteCache(); - - void setMaximumCacheSize(uint64_t size); - void setMaximumCacheEntrySize(uint64_t size); - - using Callback = std::function<void(std::unique_ptr<Response>)>; - - std::unique_ptr<WorkRequest> get(const Resource&, Callback); - void put(const Resource&, const Response&); - - class Impl; - -private: - const std::unique_ptr<util::Thread<Impl>> thread; -}; - -} // namespace mbgl - -#endif |