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

Method ParseTypes

libs/indexer/feature.cpp:274–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272}
273
274void FeatureType::ParseTypes()
275{
276 if (m_parsed.m_types)
277 return;
278
279 auto const typesOffset = sizeof(m_header);
280 Classificator & c = classif();
281 ArrayByteSource source(m_data.data() + typesOffset);
282
283 size_t const count = GetTypesCount();
284 for (size_t i = 0; i < count; ++i)
285 {
286 uint32_t index = ReadVarUint<uint32_t>(source);
287 uint32_t const type = c.GetTypeForIndex(index);
288 if (type > 0)
289 m_types[i] = type;
290 else
291 {
292 // Possible for newer MWMs with added types.
293 LOG(LWARNING, ("Incorrect type index for feature. FeatureID:", m_id, ". Incorrect index:", index,
294 ". Loaded feature types:", m_types, ". Total count of types:", count));
295
296 m_types[i] = c.GetStubType();
297 }
298 }
299
300 m_offsets.m_common = CalcOffset(source, m_data.data());
301 m_parsed.m_types = true;
302}
303
304void FeatureType::ParseCommon()
305{

Callers

nothing calls this directly

Calls 4

CalcOffsetFunction · 0.85
GetStubTypeMethod · 0.80
dataMethod · 0.45
GetTypeForIndexMethod · 0.45

Tested by

no test coverage detected