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

Function insertEdge

src/extractor/restriction_graph.cpp:16–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14{
15
16void insertEdge(RestrictionGraph &rg, const RestrictionID id, const RestrictionEdge &edge)
17{
18 const auto range = rg.GetEdges(id);
19 auto &node = rg.nodes[id];
20 if (node.edges_begin_idx + range.size() != rg.edges.size())
21 {
22 // Most nodes will only have one edge, so this copy will be infrequent
23 node.edges_begin_idx = rg.edges.size();
24 std::copy(range.begin(), range.end(), std::back_inserter(rg.edges));
25 }
26 rg.edges.push_back(edge);
27 node.num_edges += 1;
28}
29
30void insertRestriction(RestrictionGraph &rg,
31 const RestrictionID id,

Callers 2

nextMethod · 0.85
add_suffix_transferMethod · 0.85

Calls 6

copyFunction · 0.85
GetEdgesMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected