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

Function LoadCityRoads

libs/routing/city_roads.cpp:27–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27std::unique_ptr<CityRoads> LoadCityRoads(MwmSet::MwmHandle const & handle)
28{
29 auto const * value = handle.GetValue();
30 CHECK(value, ());
31
32 try
33 {
34 auto cityRoads = std::make_unique<CityRoads>();
35 if (value->m_cont.IsExist(CITY_ROADS_FILE_TAG))
36 cityRoads->Load(value->m_cont.GetReader(CITY_ROADS_FILE_TAG));
37 return cityRoads;
38 }
39 catch (Reader::Exception const & e)
40 {
41 LOG(LERROR, ("File", value->GetCountryFileName(), "Error while reading", CITY_ROADS_FILE_TAG, "section.", e.Msg()));
42 return std::make_unique<CityRoads>();
43 }
44}
45} // namespace routing

Callers 1

Calls 5

IsExistMethod · 0.80
GetCountryFileNameMethod · 0.80
GetValueMethod · 0.45
LoadMethod · 0.45
GetReaderMethod · 0.45

Tested by

no test coverage detected