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

Method GetVehicleModel

libs/routing/features_road_graph.cpp:76–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76VehicleModelInterface * FeaturesRoadGraphBase::CrossCountryVehicleModel::GetVehicleModel(
77 FeatureID const & featureId) const
78{
79 auto itr = m_cache.find(featureId.m_mwmId);
80 if (itr != m_cache.end())
81 return itr->second.get();
82
83 auto vehicleModel = m_modelFactory->GetVehicleModelForCountry(featureId.m_mwmId.GetInfo()->GetCountryName());
84
85 ASSERT(vehicleModel, ());
86 ASSERT_EQUAL(m_maxSpeed, vehicleModel->GetMaxWeightSpeed(), ());
87
88 itr = m_cache.emplace(featureId.m_mwmId, std::move(vehicleModel)).first;
89 return itr->second.get();
90}
91
92void FeaturesRoadGraphBase::CrossCountryVehicleModel::Clear()
93{

Callers 3

CreateEstimatorForCarFunction · 0.45
index_router.cppFile · 0.45

Calls 9

ASSERTFunction · 0.85
getMethod · 0.65
findMethod · 0.45
endMethod · 0.45
GetCountryNameMethod · 0.45
GetInfoMethod · 0.45
GetMaxWeightSpeedMethod · 0.45
emplaceMethod · 0.45

Tested by

no test coverage detected