blob: 673e6adfd3b2085d3ab695f2588b7ef2acc80d95 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#pragma once
#include "storage/index.hpp"
#include "platform/country_defines.hpp"
namespace storage
{
/// Country queued for downloading.
/// @TODO(bykoianko) This class assumes that a map may consist of one or two mwm files.
/// But single mwm files are used now. So this class should be redisigned to support
/// only single mwm case.
class QueuedCountry
{
public:
QueuedCountry(TCountryId const & m_countryId, MapOptions opt);
void AddOptions(MapOptions opt);
void RemoveOptions(MapOptions opt);
/// In case we can't update file using diff scheme.
void ResetToDefaultOptions();
bool SwitchToNextFile();
void SetFrozen() { m_isFrozen = true; }
bool IsFrozen() const { return m_isFrozen; }
inline TCountryId const & GetCountryId() const { return m_countryId; }
inline MapOptions GetInitOptions() const { return m_init; }
inline MapOptions GetCurrentFileOptions() const { return m_current; }
inline MapOptions GetDownloadedFilesOptions() const { return UnsetOptions(m_init, m_left); }
inline bool operator==(TCountryId const & countryId) const { return m_countryId == countryId; }
private:
TCountryId m_countryId;
MapOptions m_init;
MapOptions m_left;
MapOptions m_current;
bool m_isFrozen = false;
};
} // namespace storage
|