diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2014-09-29 14:02:42 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2014-09-29 14:02:42 +0200 |
commit | 9e44c0eae8a5e13bfddd00c7888988cb0bfb7c1f (patch) | |
tree | f24560a75c45f10623c9d119cc2ff6097b18348d /include | |
parent | 135f68e249e4b01df7d9b5387a045bfb91bc4455 (diff) | |
download | qtlocation-mapboxgl-9e44c0eae8a5e13bfddd00c7888988cb0bfb7c1f.tar.gz |
add reachability
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/map/map.hpp | 3 | ||||
-rw-r--r-- | include/mbgl/storage/base_request.hpp | 4 | ||||
-rw-r--r-- | include/mbgl/storage/file_source.hpp | 2 | ||||
-rw-r--r-- | include/mbgl/storage/http_request.hpp | 1 |
4 files changed, 10 insertions, 0 deletions
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index 85c9e8e6a5..a69943aa74 100644 --- a/include/mbgl/map/map.hpp +++ b/include/mbgl/map/map.hpp @@ -123,6 +123,9 @@ public: void toggleDebug(); bool getDebug() const; + // Call this when the network reachability changed. + void setReachability(bool status); + public: inline const TransformState &getState() const { return state; } inline util::ptr<FileSource> getFileSource() const { return fileSource; } diff --git a/include/mbgl/storage/base_request.hpp b/include/mbgl/storage/base_request.hpp index e9e6bfcb46..16ff24faa3 100644 --- a/include/mbgl/storage/base_request.hpp +++ b/include/mbgl/storage/base_request.hpp @@ -41,6 +41,10 @@ public: // This function must call notify(). virtual void cancel() = 0; + // This function is called when the request should be reattempted immediately. This is typically + // reaction to a network status change. + virtual void retryImmediately(); + public: const unsigned long thread_id; const std::string path; diff --git a/include/mbgl/storage/file_source.hpp b/include/mbgl/storage/file_source.hpp index 5933aea483..4b17cd29a7 100644 --- a/include/mbgl/storage/file_source.hpp +++ b/include/mbgl/storage/file_source.hpp @@ -36,6 +36,8 @@ public: void prepare(std::function<void()> fn); + void retryAllPending(); + private: const unsigned long thread_id; diff --git a/include/mbgl/storage/http_request.hpp b/include/mbgl/storage/http_request.hpp index 05e152aeba..ec76f1147c 100644 --- a/include/mbgl/storage/http_request.hpp +++ b/include/mbgl/storage/http_request.hpp @@ -25,6 +25,7 @@ public: ~HTTPRequest(); void cancel(); + void retryImmediately(); private: void startCacheRequest(); |