mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 13:23:59 +00:00
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
This commit is contained in:
58
drape_frontend/read_mwm_task.cpp
Normal file
58
drape_frontend/read_mwm_task.cpp
Normal file
@@ -0,0 +1,58 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user