downloadmanager return shared_ptr to FileFutures instead of bare pointers

This commit is contained in:
Michael Nilsson
2016-04-05 11:33:58 -04:00
parent e23a1f3e3c
commit 0d0f761d6e
6 changed files with 24 additions and 25 deletions

View File

@@ -63,20 +63,20 @@ public:
using DownloadProgressCallback = std::function<void(const FileFuture&)>;
using DownloadFinishedCallback = std::function<void(const FileFuture&)>;
using AsyncDownloadFinishedCallback =
std::function<void(const std::vector<FileFuture*>&)>;
std::function<void(const std::vector<std::shared_ptr<FileFuture>>&)>;
DownloadManager(std::string requestURL, int applicationVersion,
bool useMultithreadedDownload = true);
// callers responsibility to delete
// callbacks happen on a different thread
FileFuture* downloadFile(const std::string& url, const ghoul::filesystem::File& file,
std::shared_ptr<FileFuture> downloadFile(const std::string& url, const ghoul::filesystem::File& file,
bool overrideFile = true,
DownloadFinishedCallback finishedCallback = DownloadFinishedCallback(),
DownloadProgressCallback progressCallback = DownloadProgressCallback()
);
std::vector<FileFuture*> downloadRequestFiles(const std::string& identifier,
std::vector<std::shared_ptr<FileFuture>> downloadRequestFiles(const std::string& identifier,
const ghoul::filesystem::Directory& destination, int version,
bool overrideFiles = true,
DownloadFinishedCallback finishedCallback = DownloadFinishedCallback(),