Repo created
This commit is contained in:
parent
4af19165ec
commit
68073add76
12458 changed files with 12350765 additions and 2 deletions
57
libs/drape_frontend/read_mwm_task.cpp
Normal file
57
libs/drape_frontend/read_mwm_task.cpp
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
#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(std::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
|
||||
{
|
||||
std::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
|
||||
|
||||
std::shared_ptr<TileInfo> tile = m_tileInfo.lock();
|
||||
if (tile == nullptr)
|
||||
return;
|
||||
try
|
||||
{
|
||||
tile->ReadFeatures(m_model);
|
||||
}
|
||||
catch (TileInfo::ReadCanceledException &)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
} // namespace df
|
||||
Loading…
Add table
Add a link
Reference in a new issue