| 12 | namespace descriptions |
| 13 | { |
| 14 | std::string Loader::GetWikiDescription(FeatureID const & featureId, std::vector<localisation::LanguageIndex> const & prioritizedLanguageIndexes) |
| 15 | { |
| 16 | auto const handle = m_dataSource.GetMwmHandleById(featureId.m_mwmId); |
| 17 | |
| 18 | if (!handle.IsAlive()) |
| 19 | return {}; |
| 20 | |
| 21 | auto const & value = *handle.GetValue(); |
| 22 | |
| 23 | if (!value.m_cont.IsExist(DESCRIPTIONS_FILE_TAG)) |
| 24 | return {}; |
| 25 | |
| 26 | EntryPtr entry; |
| 27 | { |
| 28 | std::lock_guard<std::mutex> lock(m_mutex); |
| 29 | entry = m_deserializers.try_emplace(featureId.m_mwmId, std::make_shared<Entry>()).first->second; |
| 30 | } |
| 31 | |
| 32 | ASSERT(entry, ()); |
| 33 | |
| 34 | auto readerPtr = value.m_cont.GetReader(DESCRIPTIONS_FILE_TAG); |
| 35 | |
| 36 | std::lock_guard<std::mutex> lock(entry->m_mutex); |
| 37 | return entry->m_deserializer.Deserialize(*readerPtr.GetPtr(), featureId.m_index, prioritizedLanguageIndexes); |
| 38 | } |
| 39 | } // namespace descriptions |
no test coverage detected