11#pragma once
22
3+ #include " osr/routing/additional_edge.h"
34#include " osr/routing/dial.h"
45#include " osr/types.h"
56#include " osr/ways.h"
67
78namespace osr {
89
10+ struct sharing_data ;
11+
912template <typename Profile>
1013struct dijkstra {
1114 using profile_t = Profile;
@@ -40,7 +43,8 @@ struct dijkstra {
4043 template <direction SearchDir, bool WithBlocked>
4144 void run (ways::routing const & r,
4245 cost_t const max,
43- bitvec<node_idx_t > const * blocked) {
46+ bitvec<node_idx_t > const * blocked,
47+ sharing_data const * sharing) {
4448 while (!pq_.empty ()) {
4549 auto l = pq_.pop ();
4650 if (get_cost (l.get_node ()) < l.cost ()) {
@@ -49,7 +53,7 @@ struct dijkstra {
4953
5054 auto const curr = l.get_node ();
5155 Profile::template adjacent<SearchDir, WithBlocked>(
52- r, curr, blocked,
56+ r, curr, blocked, sharing,
5357 [&](node const neighbor, std::uint32_t const cost, distance_t ,
5458 way_idx_t const way, std::uint16_t , std::uint16_t ) {
5559 auto const total = l.cost () + cost;
@@ -67,20 +71,21 @@ struct dijkstra {
6771 void run (ways::routing const & r,
6872 cost_t const max,
6973 bitvec<node_idx_t > const * blocked,
74+ sharing_data const * sharing,
7075 direction const dir) {
7176 if (blocked == nullptr ) {
7277 dir == direction::kForward
73- ? run<direction::kForward , false >(r, max, blocked)
74- : run<direction::kBackward , false >(r, max, blocked);
78+ ? run<direction::kForward , false >(r, max, blocked, sharing )
79+ : run<direction::kBackward , false >(r, max, blocked, sharing );
7580 } else {
7681 dir == direction::kForward
77- ? run<direction::kForward , true >(r, max, blocked)
78- : run<direction::kBackward , true >(r, max, blocked);
82+ ? run<direction::kForward , true >(r, max, blocked, sharing )
83+ : run<direction::kBackward , true >(r, max, blocked, sharing );
7984 }
8085 }
8186
8287 dial<label, get_bucket> pq_{get_bucket{}};
8388 ankerl::unordered_dense::map<key, entry, hash> cost_;
8489};
8590
86- } // namespace osr
91+ } // namespace osr
0 commit comments