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

Method GetParentIdFor

libs/storage/storage.cpp:2258–2275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2256}
2257
2258CountryId const Storage::GetParentIdFor(CountryId const & countryId) const
2259{
2260 CountryTree::NodesBufferT nodes;
2261 m_countries.Find(countryId, nodes);
2262 if (nodes.empty())
2263 {
2264 LOG(LWARNING, ("CountryId =", countryId, "not found in m_countries."));
2265 return string();
2266 }
2267
2268 if (nodes.size() > 1)
2269 {
2270 // Disputed territory. Has multiple parents.
2271 return string();
2272 }
2273
2274 return nodes[0]->Value().GetParent();
2275}
2276
2277CountryId const Storage::GetTopmostParentFor(CountryId const & countryId) const
2278{

Callers 2

operator()Method · 0.80
FrameworkMethod · 0.80

Calls 5

FindMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45
GetParentMethod · 0.45
ValueMethod · 0.45

Tested by

no test coverage detected