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

Method IndexRouter

libs/routing/index_router.cpp:247–278  ·  view source on GitHub ↗

IndexRouter ------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

245
246// IndexRouter ------------------------------------------------------------------------------------
247IndexRouter::IndexRouter(VehicleType vehicleType, bool loadAltitudes,
248 CountryParentNameGetterFn const & countryParentNameGetterFn,
249 TCountryFileFn const & countryFileFn, CountryRectFn const & countryRectFn,
250 shared_ptr<NumMwmIds> numMwmIds, unique_ptr<m4::Tree<NumMwmId>> numMwmTree,
251 traffic::TrafficCache const & trafficCache, DataSource & dataSource)
252 : m_vehicleType(vehicleType)
253 , m_loadAltitudes(loadAltitudes)
254 , m_name("astar-bidirectional-" + ToString(m_vehicleType))
255 , m_dataSource(dataSource, numMwmIds)
256 , m_vehicleModelFactory(CreateVehicleModelFactory(m_vehicleType, countryParentNameGetterFn))
257 , m_countryFileFn(countryFileFn)
258 , m_countryRectFn(countryRectFn)
259 , m_numMwmIds(std::move(numMwmIds))
260 , m_numMwmTree(std::move(numMwmTree))
261 , m_trafficStash(CreateTrafficStash(m_vehicleType, m_numMwmIds, trafficCache))
262 , m_roadGraph(m_dataSource,
263 vehicleType == VehicleType::Pedestrian || vehicleType == VehicleType::Transit
264 ? IRoadGraph::Mode::IgnoreOnewayTag
265 : IRoadGraph::Mode::ObeyOnewayTag,
266 m_vehicleModelFactory)
267 , m_estimator(EdgeEstimator::Create(m_vehicleType, CalcMaxSpeed(*m_numMwmIds, *m_vehicleModelFactory, m_vehicleType),
268 CalcOffroadSpeed(*m_vehicleModelFactory), m_trafficStash, &dataSource,
269 m_numMwmIds))
270 , m_directionsEngine(CreateDirectionsEngine(m_vehicleType, m_numMwmIds, m_dataSource))
271 , m_countryParentNameGetterFn(countryParentNameGetterFn)
272{
273 CHECK(!m_name.empty(), ());
274 CHECK(m_numMwmIds, ());
275 CHECK(m_numMwmTree, ());
276 CHECK(m_estimator, ());
277 CHECK(m_directionsEngine, ());
278}
279
280IndexRouter::~IndexRouter() = default;
281

Callers

nothing calls this directly

Calls 7

CreateTrafficStashFunction · 0.85
CreateFunction · 0.85
CalcMaxSpeedFunction · 0.85
CreateDirectionsEngineFunction · 0.85
ToStringFunction · 0.70
emptyMethod · 0.45

Tested by

no test coverage detected