blob: 675e75ddea9a7377843dc5a986bb0d349e8579de (
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
#include "drape_frontend/read_mwm_task.hpp"
namespace df
{
ReadMWMTask::ReadMWMTask(MapDataProvider & model)
: m_model(model)
{
#ifdef DEBUG
m_checker = false;
#endif
}
void ReadMWMTask::Init(shared_ptr<TileInfo> const & tileInfo)
{
m_tileInfo = tileInfo;
m_tileKey = tileInfo->GetTileKey();
#ifdef DEBUG
m_checker = true;
#endif
}
void ReadMWMTask::Reset()
{
#ifdef DEBUG
m_checker = false;
#endif
m_tileInfo.reset();
IRoutine::Reset();
}
bool ReadMWMTask::IsCancelled() const
{
shared_ptr<TileInfo> tile = m_tileInfo.lock();
if (tile == nullptr)
return true;
return tile->IsCancelled() || IRoutine::IsCancelled();
}
void ReadMWMTask::Do()
{
#ifdef DEBUG
ASSERT(m_checker, ());
#endif
shared_ptr<TileInfo> tile = m_tileInfo.lock();
if (tile == nullptr)
return;
try
{
tile->ReadFeatures(m_model);
}
catch (TileInfo::ReadCanceledException &)
{
return;
}
}
} // namespace df
|