Repo created
This commit is contained in:
parent
4af19165ec
commit
68073add76
12458 changed files with 12350765 additions and 2 deletions
45
libs/storage/http_map_files_downloader.hpp
Normal file
45
libs/storage/http_map_files_downloader.hpp
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
#pragma once
|
||||
|
||||
#include "storage/downloader_queue_universal.hpp"
|
||||
#include "storage/map_files_downloader_with_ping.hpp"
|
||||
|
||||
#include "platform/http_request.hpp"
|
||||
|
||||
#include "base/thread_checker.hpp"
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace storage
|
||||
{
|
||||
/// This class encapsulates HTTP requests for receiving server lists
|
||||
/// and file downloading.
|
||||
//
|
||||
// *NOTE*, this class is not thread-safe.
|
||||
class HttpMapFilesDownloader : public MapFilesDownloader
|
||||
{
|
||||
public:
|
||||
virtual ~HttpMapFilesDownloader();
|
||||
|
||||
// MapFilesDownloader overrides:
|
||||
void Remove(CountryId const & id) override;
|
||||
void Clear() override;
|
||||
QueueInterface const & GetQueue() const override;
|
||||
|
||||
private:
|
||||
// MapFilesDownloader overrides:
|
||||
void Download(QueuedCountry && queuedCountry) override;
|
||||
|
||||
void Download();
|
||||
|
||||
void OnMapFileDownloaded(QueuedCountry const & queuedCountry, downloader::HttpRequest & request);
|
||||
void OnMapFileDownloadingProgress(QueuedCountry const & queuedCountry, downloader::HttpRequest & request);
|
||||
|
||||
std::unique_ptr<downloader::HttpRequest> m_request;
|
||||
Queue m_queue;
|
||||
|
||||
DECLARE_THREAD_CHECKER(m_checker);
|
||||
};
|
||||
} // namespace storage
|
||||
Loading…
Add table
Add a link
Reference in a new issue