summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-05-13 16:11:49 +0300
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-05-14 11:29:24 +0300
commit7e77aff8dfc2434846614f919cd4f8db1a2ca2f0 (patch)
tree85d7252bd36ec4c534337d2dc9d0a983265e677e
parent953ee5e81bee613680468438e3efe4f7c3ff68f6 (diff)
downloadqtlocation-mapboxgl-7e77aff8dfc2434846614f919cd4f8db1a2ca2f0.tar.gz
[core] Make FileSource API clearer
-rw-r--r--include/mbgl/storage/file_source.hpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/include/mbgl/storage/file_source.hpp b/include/mbgl/storage/file_source.hpp
index 868dbf7347..2270038c49 100644
--- a/include/mbgl/storage/file_source.hpp
+++ b/include/mbgl/storage/file_source.hpp
@@ -4,9 +4,7 @@
#include <mbgl/storage/response.hpp>
#include <mbgl/storage/resource.hpp>
-#include <mbgl/util/noncopyable.hpp>
#include <mbgl/util/async_request.hpp>
-#include <mbgl/util/optional.hpp>
#include <functional>
#include <memory>
@@ -16,8 +14,10 @@ namespace mbgl {
class ResourceOptions;
class ResourceTransform;
-class FileSource : private util::noncopyable {
+class FileSource {
public:
+ FileSource(const FileSource&) = delete;
+ FileSource& operator=(const FileSource&) = delete;
virtual ~FileSource() = default;
using Callback = std::function<void (Response)>;
@@ -37,12 +37,14 @@ public:
return false;
}
- // Factory for creating a platform-specific file source.
- static std::shared_ptr<FileSource> createPlatformFileSource(const ResourceOptions&);
-
// Singleton for obtaining the shared platform-specific file source. A single instance of a file source is provided
// for each unique combination of a Mapbox API base URL, access token, cache path and platform context.
static std::shared_ptr<FileSource> getSharedFileSource(const ResourceOptions&);
+
+protected:
+ FileSource() = default;
+ // Factory for creating a platform-specific file source.
+ static std::shared_ptr<FileSource> createPlatformFileSource(const ResourceOptions&);
};
} // namespace mbgl