clang-format code
This commit is contained in:
@@ -84,11 +84,12 @@ namespace
|
||||
// Abstracted away the query locking into a template function
|
||||
// Works the same for every plugin.
|
||||
template <typename ParameterT, typename PluginT, typename ResultT>
|
||||
osrm::engine::Status RunQuery(const std::unique_ptr<osrm::engine::Engine::EngineLock> &lock,
|
||||
const std::shared_ptr<osrm::engine::datafacade::BaseDataFacade> &facade,
|
||||
const ParameterT ¶meters,
|
||||
PluginT &plugin,
|
||||
ResultT &result)
|
||||
osrm::engine::Status
|
||||
RunQuery(const std::unique_ptr<osrm::engine::Engine::EngineLock> &lock,
|
||||
const std::shared_ptr<osrm::engine::datafacade::BaseDataFacade> &facade,
|
||||
const ParameterT ¶meters,
|
||||
PluginT &plugin,
|
||||
ResultT &result)
|
||||
{
|
||||
if (!lock)
|
||||
{
|
||||
@@ -130,8 +131,7 @@ Engine::Engine(const EngineConfig &config)
|
||||
{
|
||||
throw util::exception("Invalid file paths given!");
|
||||
}
|
||||
query_data_facade =
|
||||
std::make_shared<datafacade::InternalDataFacade>(config.storage_config);
|
||||
query_data_facade = std::make_shared<datafacade::InternalDataFacade>(config.storage_config);
|
||||
}
|
||||
|
||||
// Register plugins
|
||||
|
||||
@@ -167,7 +167,10 @@ Status MatchPlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFaca
|
||||
|
||||
// call the actual map matching
|
||||
SubMatchingList sub_matchings = map_matching(*facade,
|
||||
candidates_lists, parameters.coordinates, parameters.timestamps, parameters.radiuses);
|
||||
candidates_lists,
|
||||
parameters.coordinates,
|
||||
parameters.timestamps,
|
||||
parameters.radiuses);
|
||||
|
||||
if (sub_matchings.size() == 0)
|
||||
{
|
||||
@@ -193,7 +196,8 @@ Status MatchPlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFaca
|
||||
// force uturns to be on, since we split the phantom nodes anyway and only have
|
||||
// bi-directional
|
||||
// phantom nodes for possible uturns
|
||||
shortest_path(*facade, sub_routes[index].segment_end_coordinates, {false}, sub_routes[index]);
|
||||
shortest_path(
|
||||
*facade, sub_routes[index].segment_end_coordinates, {false}, sub_routes[index]);
|
||||
BOOST_ASSERT(sub_routes[index].shortest_path_length != INVALID_EDGE_WEIGHT);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,10 +17,7 @@ namespace engine
|
||||
namespace plugins
|
||||
{
|
||||
|
||||
NearestPlugin::NearestPlugin(const int max_results_)
|
||||
: max_results{max_results_}
|
||||
{
|
||||
}
|
||||
NearestPlugin::NearestPlugin(const int max_results_) : max_results{max_results_} {}
|
||||
|
||||
Status NearestPlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacade> facade,
|
||||
const api::NearestParameters ¶ms,
|
||||
|
||||
@@ -24,8 +24,7 @@ namespace plugins
|
||||
{
|
||||
|
||||
TablePlugin::TablePlugin(const int max_locations_distance_table)
|
||||
: distance_table(heaps),
|
||||
max_locations_distance_table(max_locations_distance_table)
|
||||
: distance_table(heaps), max_locations_distance_table(max_locations_distance_table)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -61,7 +60,8 @@ Status TablePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFaca
|
||||
}
|
||||
|
||||
auto snapped_phantoms = SnapPhantomNodes(GetPhantomNodes(*facade, params));
|
||||
auto result_table = distance_table(*facade, snapped_phantoms, params.sources, params.destinations);
|
||||
auto result_table =
|
||||
distance_table(*facade, snapped_phantoms, params.sources, params.destinations);
|
||||
|
||||
if (result_table.empty())
|
||||
{
|
||||
|
||||
+25
-21
@@ -1,6 +1,6 @@
|
||||
#include "engine/plugins/tile.hpp"
|
||||
#include "engine/edge_unpacker.hpp"
|
||||
#include "engine/plugins/plugin_base.hpp"
|
||||
#include "engine/plugins/tile.hpp"
|
||||
|
||||
#include "util/coordinate_calculation.hpp"
|
||||
#include "util/vector_tile.hpp"
|
||||
@@ -511,19 +511,23 @@ Status TilePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacad
|
||||
// when exactly? Anyway, unpack it and get the first "real" edgedata
|
||||
// out of it, which should represent the first hop, which is the one
|
||||
// we want to find the turn.
|
||||
const auto &data =
|
||||
[this, &facade, smaller_edge_id, source_ebn, target_ebn, &unpacked_shortcut]() {
|
||||
const auto inner_data = facade->GetEdgeData(smaller_edge_id);
|
||||
if (inner_data.shortcut)
|
||||
{
|
||||
unpacked_shortcut.clear();
|
||||
UnpackEdgeToEdges(
|
||||
*facade, source_ebn.first, target_ebn, unpacked_shortcut);
|
||||
return unpacked_shortcut.front();
|
||||
}
|
||||
else
|
||||
return inner_data;
|
||||
}();
|
||||
const auto &data = [this,
|
||||
&facade,
|
||||
smaller_edge_id,
|
||||
source_ebn,
|
||||
target_ebn,
|
||||
&unpacked_shortcut]() {
|
||||
const auto inner_data = facade->GetEdgeData(smaller_edge_id);
|
||||
if (inner_data.shortcut)
|
||||
{
|
||||
unpacked_shortcut.clear();
|
||||
UnpackEdgeToEdges(
|
||||
*facade, source_ebn.first, target_ebn, unpacked_shortcut);
|
||||
return unpacked_shortcut.front();
|
||||
}
|
||||
else
|
||||
return inner_data;
|
||||
}();
|
||||
BOOST_ASSERT_MSG(!data.shortcut, "Connecting edge must not be a shortcut");
|
||||
|
||||
// This is the geometry leading away from the intersection
|
||||
@@ -535,7 +539,7 @@ Status TilePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacad
|
||||
// Now, calculate the sum of the weight of all the segments.
|
||||
forward_weight_vector.clear();
|
||||
facade->GetUncompressedWeights(source_ebn.second.packed_geometry_id,
|
||||
forward_weight_vector);
|
||||
forward_weight_vector);
|
||||
const auto sum_node_weight = std::accumulate(
|
||||
forward_weight_vector.begin(), forward_weight_vector.end(), EdgeWeight{0});
|
||||
|
||||
@@ -620,7 +624,7 @@ Status TilePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacad
|
||||
|
||||
forward_datasource_vector.clear();
|
||||
facade->GetUncompressedDatasources(edge.forward_packed_geometry_id,
|
||||
forward_datasource_vector);
|
||||
forward_datasource_vector);
|
||||
forward_datasource = forward_datasource_vector[edge.fwd_segment_position];
|
||||
|
||||
use_line_value(forward_weight);
|
||||
@@ -638,7 +642,7 @@ Status TilePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacad
|
||||
|
||||
reverse_datasource_vector.clear();
|
||||
facade->GetUncompressedDatasources(edge.reverse_packed_geometry_id,
|
||||
reverse_datasource_vector);
|
||||
reverse_datasource_vector);
|
||||
reverse_datasource = reverse_datasource_vector[reverse_datasource_vector.size() -
|
||||
edge.fwd_segment_position - 1];
|
||||
|
||||
@@ -707,12 +711,12 @@ Status TilePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacad
|
||||
{
|
||||
forward_weight_vector.clear();
|
||||
facade->GetUncompressedWeights(edge.forward_packed_geometry_id,
|
||||
forward_weight_vector);
|
||||
forward_weight_vector);
|
||||
forward_weight = forward_weight_vector[edge.fwd_segment_position];
|
||||
|
||||
forward_datasource_vector.clear();
|
||||
facade->GetUncompressedDatasources(edge.forward_packed_geometry_id,
|
||||
forward_datasource_vector);
|
||||
forward_datasource_vector);
|
||||
forward_datasource = forward_datasource_vector[edge.fwd_segment_position];
|
||||
}
|
||||
|
||||
@@ -720,7 +724,7 @@ Status TilePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacad
|
||||
{
|
||||
reverse_weight_vector.clear();
|
||||
facade->GetUncompressedWeights(edge.reverse_packed_geometry_id,
|
||||
reverse_weight_vector);
|
||||
reverse_weight_vector);
|
||||
|
||||
BOOST_ASSERT(edge.fwd_segment_position < reverse_weight_vector.size());
|
||||
|
||||
@@ -729,7 +733,7 @@ Status TilePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacad
|
||||
|
||||
reverse_datasource_vector.clear();
|
||||
facade->GetUncompressedDatasources(edge.reverse_packed_geometry_id,
|
||||
reverse_datasource_vector);
|
||||
reverse_datasource_vector);
|
||||
reverse_datasource =
|
||||
reverse_datasource_vector[reverse_datasource_vector.size() -
|
||||
edge.fwd_segment_position - 1];
|
||||
|
||||
@@ -114,7 +114,7 @@ SCC_Component SplitUnaccessibleLocations(const std::size_t number_of_locations,
|
||||
return SCC_Component(std::move(components), std::move(range));
|
||||
}
|
||||
|
||||
InternalRouteResult TripPlugin::ComputeRoute(const datafacade::BaseDataFacade& facade,
|
||||
InternalRouteResult TripPlugin::ComputeRoute(const datafacade::BaseDataFacade &facade,
|
||||
const std::vector<PhantomNode> &snapped_phantoms,
|
||||
const std::vector<NodeID> &trip)
|
||||
{
|
||||
|
||||
@@ -98,7 +98,9 @@ Status ViaRoutePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataF
|
||||
else
|
||||
{
|
||||
shortest_path(*facade,
|
||||
raw_route.segment_end_coordinates, route_parameters.continue_straight, raw_route);
|
||||
raw_route.segment_end_coordinates,
|
||||
route_parameters.continue_straight,
|
||||
raw_route);
|
||||
}
|
||||
|
||||
// we can only know this after the fact, different SCC ids still
|
||||
|
||||
Reference in New Issue
Block a user