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

Method InitRouter

libs/routing/routes_builder/routes_builder.cpp:266–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

264}
265
266void RoutesBuilder::Processor::InitRouter(VehicleType type)
267{
268 if (m_router && m_router->GetVehicleType() == type)
269 return;
270
271 auto const & cig = m_cig;
272 auto const countryFileGetter = [cig](m2::PointD const & pt)
273 {
274 auto const cigSharedPtr = cig.lock();
275 return cigSharedPtr->GetRegionCountryId(pt);
276 };
277
278 auto const getMwmRectByName = [cig](std::string const & countryId)
279 {
280 auto const cigSharedPtr = cig.lock();
281 return cigSharedPtr->GetLimitRectForLeaf(countryId);
282 };
283
284 bool const loadAltitudes = type != VehicleType::Car;
285 if (!m_dataSource)
286 m_dataSource = m_dataSourceStorage.GetDataSource();
287
288 m_router = std::make_unique<IndexRouter>(type, loadAltitudes, *m_cpg.lock(), countryFileGetter, getMwmRectByName,
289 m_numMwmIds, MakeNumMwmTree(*m_numMwmIds, *m_cig.lock()), *m_trafficCache,
290 *m_dataSource);
291}
292
293RoutesBuilder::Result RoutesBuilder::Processor::operator()(Params const & params)
294{

Callers

nothing calls this directly

Calls 6

MakeNumMwmTreeFunction · 0.85
lockMethod · 0.80
GetRegionCountryIdMethod · 0.80
GetLimitRectForLeafMethod · 0.80
GetDataSourceMethod · 0.80
GetVehicleTypeMethod · 0.45

Tested by

no test coverage detected