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

Method CreateIndexGraph

libs/routing/index_graph_loader.cpp:143–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143IndexGraphLoaderImpl::GraphPtrT IndexGraphLoaderImpl::CreateIndexGraph(NumMwmId numMwmId, GeometryPtrT & geometry)
144{
145 MwmSet::MwmHandle const & handle = m_dataSource.GetHandle(numMwmId);
146 MwmValue const * value = handle.GetValue();
147
148 try
149 {
150 base::Timer timer;
151
152 if (!geometry)
153 {
154 auto vehicleModel = m_vehicleModelFactory->GetVehicleModelForCountry(value->GetCountryFileName());
155 geometry = make_shared<Geometry>(GeometryLoader::Create(handle, std::move(vehicleModel), m_loadAltitudes));
156 }
157
158 auto graph = make_unique<IndexGraph>(geometry, m_estimator, m_avoidRoutingOptions, &value->GetRegionData());
159 graph->SetCurrentTimeGetter(m_currentTimeGetter);
160 DeserializeIndexGraph(*value, m_vehicleType, *graph);
161
162 LOG(LINFO,
163 (ROUTING_FILE_TAG, "section for", value->GetCountryFileName(), "loaded in", timer.ElapsedSeconds(), "seconds"));
164 return graph;
165 }
166 catch (RootException const & ex)
167 {
168 LOG(LERROR, ("Error reading graph for", value->m_file));
169 throw;
170 }
171}
172
173IndexGraphLoaderImpl::GeometryPtrT IndexGraphLoaderImpl::CreateGeometry(NumMwmId numMwmId)
174{

Callers

nothing calls this directly

Calls 9

CreateFunction · 0.85
DeserializeIndexGraphFunction · 0.85
GetHandleMethod · 0.80
GetCountryFileNameMethod · 0.80
GetRegionDataMethod · 0.80
ElapsedSecondsMethod · 0.80
GetValueMethod · 0.45
SetCurrentTimeGetterMethod · 0.45

Tested by

no test coverage detected