From 2fa8d0f53407af6e4d4751125cb2e64af2609b6e Mon Sep 17 00:00:00 2001 From: Patrick Niklaus Date: Mon, 9 Jan 2017 20:40:33 +0000 Subject: [PATCH] Port OSRM, Engine and Datafacades to be algorithm aware --- include/engine/algorithm.hpp | 37 ++ include/engine/data_watchdog.hpp | 13 +- .../datafacade/algorithm_datafacade.hpp | 61 +++ .../contiguous_internalmem_datafacade.hpp | 250 ++++++----- include/engine/datafacade/datafacade_base.hpp | 38 +- include/engine/datafacade_provider.hpp | 56 +++ include/engine/engine.hpp | 102 ++++- include/engine/plugins/match.hpp | 11 +- include/engine/plugins/nearest.hpp | 5 +- include/engine/plugins/plugin_base.hpp | 9 +- include/engine/plugins/table.hpp | 6 +- include/engine/plugins/tile.hpp | 9 +- include/engine/plugins/trip.hpp | 18 +- include/engine/plugins/viaroute.hpp | 15 +- include/engine/routing_algorithms.hpp | 125 ++++++ .../routing_algorithms/alternative_path.hpp | 34 +- .../direct_shortest_path.hpp | 19 +- .../routing_algorithms/many_to_many.hpp | 39 +- .../routing_algorithms/map_matching.hpp | 16 +- .../routing_algorithms/routing_base.hpp | 113 ++--- .../routing_algorithms/shortest_path.hpp | 21 +- .../engine/routing_algorithms/tile_turns.hpp | 46 ++ include/engine/trip/trip_brute_force.hpp | 12 +- .../engine/trip/trip_farthest_insertion.hpp | 15 +- include/osrm/osrm.hpp | 2 +- include/osrm/osrm_fwd.hpp | 2 +- include/storage/shared_datatype.hpp | 14 +- src/engine/engine.cpp | 110 ----- src/engine/hint.cpp | 6 +- src/engine/plugins/match.cpp | 22 +- src/engine/plugins/nearest.cpp | 12 +- src/engine/plugins/table.cpp | 11 +- src/engine/plugins/tile.cpp | 413 ++++-------------- src/engine/plugins/trip.cpp | 23 +- src/engine/plugins/viaroute.cpp | 31 +- .../routing_algorithms/alternative_path.cpp | 87 ++-- .../direct_shortest_path.cpp | 10 +- .../routing_algorithms/many_to_many.cpp | 14 +- .../routing_algorithms/map_matching.cpp | 15 +- .../routing_algorithms/routing_base.cpp | 133 +++--- .../routing_algorithms/shortest_path.cpp | 99 ++--- src/engine/routing_algorithms/tile_turns.cpp | 228 ++++++++++ src/osrm/osrm.cpp | 6 +- src/storage/storage.cpp | 12 +- unit_tests/engine/base64.cpp | 4 +- unit_tests/mocks/mock_datafacade.hpp | 95 ++-- unit_tests/util/static_rtree.cpp | 12 +- 47 files changed, 1384 insertions(+), 1047 deletions(-) create mode 100644 include/engine/algorithm.hpp create mode 100644 include/engine/datafacade/algorithm_datafacade.hpp create mode 100644 include/engine/datafacade_provider.hpp create mode 100644 include/engine/routing_algorithms.hpp create mode 100644 include/engine/routing_algorithms/tile_turns.hpp delete mode 100644 src/engine/engine.cpp create mode 100644 src/engine/routing_algorithms/tile_turns.cpp diff --git a/include/engine/algorithm.hpp b/include/engine/algorithm.hpp new file mode 100644 index 000000000..23760fc06 --- /dev/null +++ b/include/engine/algorithm.hpp @@ -0,0 +1,37 @@ +#ifndef OSRM_ENGINE_ALGORITHM_HPP +#define OSRM_ENGINE_ALGORITHM_HPP + +namespace osrm +{ +namespace engine +{ +namespace algorithm +{ + +// Contraction Hiearchy +struct CH; +} + +namespace algorithm_trais +{ +template struct HasAlternativeRouting final +{ + template