| 42 | } |
| 43 | |
| 44 | std::vector<const TurnRestriction *> |
| 45 | WayRestrictionMap::GetRestrictions(DuplicatedNodeID duplicated_node, const NodeID to) const |
| 46 | { |
| 47 | std::vector<const TurnRestriction *> result; |
| 48 | // Fetch all restrictions that will restrict a turn to 'to'. |
| 49 | BOOST_ASSERT(duplicated_node < restriction_graph.num_via_nodes); |
| 50 | const auto &restrictions = restriction_graph.GetRestrictions(duplicated_node); |
| 51 | std::copy_if(restrictions.begin(), |
| 52 | restrictions.end(), |
| 53 | std::back_inserter(result), |
| 54 | [&to](const auto &restriction) { return restriction->IsTurnRestricted(to); }); |
| 55 | if (result.empty()) |
| 56 | { |
| 57 | throw( |
| 58 | "Asking for the restriction of an unrestricted turn. Check with `IsRestricted` before " |
| 59 | "calling GetRestriction"); |
| 60 | } |
| 61 | return result; |
| 62 | } |
| 63 | |
| 64 | std::vector<WayRestrictionMap::ViaEdge> WayRestrictionMap::DuplicatedViaEdges() const |
| 65 | { |
no test coverage detected