blob: 726d708d5554f7bfcc017ea756b5fc48bdb80b78 (
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
|
#include "drape_frontend/read_mwm_task.hpp"
#include "std/shared_ptr.hpp"
namespace df
{
ReadMWMTask::ReadMWMTask(MemoryFeatureIndex & memIndex, MapDataProvider & model,
EngineContext & context)
: m_memIndex(memIndex)
, m_model(model)
, m_context(context)
{
#ifdef DEBUG
m_checker = false;
#endif
}
void ReadMWMTask::Init(weak_ptr<TileInfo> const & tileInfo)
{
m_tileInfo = tileInfo;
#ifdef DEBUG
m_checker = true;
#endif
}
void ReadMWMTask::Reset()
{
#ifdef DEBUG
m_checker = false;
#endif
}
void ReadMWMTask::Do()
{
#ifdef DEBUG
ASSERT(m_checker, ());
#endif
shared_ptr<TileInfo> tileInfo = m_tileInfo.lock();
if (tileInfo == NULL)
return;
try
{
tileInfo->ReadFeatureIndex(m_model);
tileInfo->ReadFeatures(m_model, m_memIndex, m_context);
}
catch (TileInfo::ReadCanceledException & ex)
{
return;
}
}
} // namespace df
|