mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 04:53:36 +00:00
@@ -700,9 +700,8 @@ void Generator::InitCountryInfoGetter(std::string const & dataDir)
|
|||||||
|
|
||||||
GetPlatform().SetResourceDir(dataDir);
|
GetPlatform().SetResourceDir(dataDir);
|
||||||
|
|
||||||
m_infoGetter = storage::CountryInfoReader::CreateCountryInfoReader(GetPlatform());
|
m_infoReader = storage::CountryInfoReader::CreateCountryInfoReader(GetPlatform());
|
||||||
CHECK(m_infoGetter, ());
|
CHECK(m_infoReader, ());
|
||||||
m_infoReader = static_cast<storage::CountryInfoReader *>(m_infoGetter.get());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Generator::InitProfiles(std::string const & isolinesProfilesFileName,
|
void Generator::InitProfiles(std::string const & isolinesProfilesFileName,
|
||||||
@@ -767,6 +766,8 @@ void Generator::GetCountryRegions(storage::CountryId const & countryId, m2::Rect
|
|||||||
}
|
}
|
||||||
CHECK_LESS(id, m_infoReader->GetCountries().size(), ());
|
CHECK_LESS(id, m_infoReader->GetCountries().size(), ());
|
||||||
|
|
||||||
|
/// @todo Refactor using Memory[Mapped] reader for countries.
|
||||||
|
std::lock_guard guard(m_infoMutex);
|
||||||
m_infoReader->LoadRegionsFromDisk(id, countryRegions);
|
m_infoReader->LoadRegionsFromDisk(id, countryRegions);
|
||||||
}
|
}
|
||||||
} // namespace topography_generator
|
} // namespace topography_generator
|
||||||
|
|||||||
@@ -91,8 +91,8 @@ private:
|
|||||||
ProfileToTileIsolinesParams m_profileToTileParams;
|
ProfileToTileIsolinesParams m_profileToTileParams;
|
||||||
ProfileToIsolinesPackingParams m_profileToPackingParams;
|
ProfileToIsolinesPackingParams m_profileToPackingParams;
|
||||||
|
|
||||||
std::unique_ptr<storage::CountryInfoGetter> m_infoGetter;
|
std::mutex m_infoMutex;
|
||||||
storage::CountryInfoReader * m_infoReader = nullptr;
|
std::unique_ptr<storage::CountryInfoReader> m_infoReader;
|
||||||
|
|
||||||
// They can't be negative, it is done to avoid compiler warnings.
|
// They can't be negative, it is done to avoid compiler warnings.
|
||||||
long m_threadsCount;
|
long m_threadsCount;
|
||||||
|
|||||||
Reference in New Issue
Block a user