MCPcopy Create free account
hub / github.com/Project-OSRM/osrm-backend / buildGraph

Function buildGraph

src/extractor/restriction_graph.cpp:213–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211
212template <typename builder_type>
213void buildGraph(RestrictionGraph &rg, const std::vector<TurnRestriction> &restrictions)
214{
215 const auto run_builder = [&](const auto &restriction)
216 {
217 builder_type builder(rg);
218
219 builder.start(restriction.turn_path.From(), restriction.turn_path.FirstVia());
220 if (restriction.turn_path.Type() == TurnPathType::VIA_WAY_TURN_PATH)
221 {
222 const auto &via_way_path = restriction.turn_path.AsViaWayPath();
223 util::for_each_pair(via_way_path.via,
224 [&](NodeID from, NodeID to) { builder.next(from, to); });
225 }
226 builder.end(restriction);
227 };
228
229 std::for_each(restrictions.begin(), restrictions.end(), run_builder);
230}
231} // namespace restriction_graph_details
232
233RestrictionGraph constructRestrictionGraph(const std::vector<TurnRestriction> &turn_restrictions)

Callers

nothing calls this directly

Calls 8

for_each_pairFunction · 0.85
FirstViaMethod · 0.80
startMethod · 0.45
FromMethod · 0.45
TypeMethod · 0.45
nextMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected