MCPcopy Create free account
hub / github.com/comaps/comaps / GetWikiDescription

Method GetWikiDescription

libs/descriptions/loader.cpp:14–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12namespace descriptions
13{
14std::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

Callers 6

CreateMapObjectFunction · 0.80
CreateTrackFunction · 0.80
CreateBookmarkFunction · 0.80
PlacePageDialogUserMethod · 0.80
FillDescriptionsMethod · 0.80

Calls 8

ASSERTFunction · 0.85
IsExistMethod · 0.80
GetMwmHandleByIdMethod · 0.45
IsAliveMethod · 0.45
GetValueMethod · 0.45
GetReaderMethod · 0.45
DeserializeMethod · 0.45
GetPtrMethod · 0.45

Tested by

no test coverage detected