Files
comaps/storage/http_map_files_downloader.hpp
Konstantin Pastbin e3e4a1985a Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run:
  git remote add om-historic [om-historic.git repo url]
  git fetch --tags om-historic
  git replace squashed-history historic-commits
2025-05-08 21:10:51 +07:00

47 lines
1.2 KiB
C++

#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 MapFilesDownloaderWithPing
{
public:
virtual ~HttpMapFilesDownloader();
// MapFilesDownloader overrides:
void Remove(CountryId const & id) override;
void Clear() override;
QueueInterface const & GetQueue() const override;
private:
// MapFilesDownloaderWithServerList 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