Passed ResultT down to engine plugins, so now they can form replies in different formats.

This commit is contained in:
Denis Chaplygin
2019-08-02 17:40:55 +03:00
parent f6f86b2a52
commit 75aadb0f3f
32 changed files with 136 additions and 99 deletions
+3 -2
View File
@@ -31,8 +31,9 @@ TablePlugin::TablePlugin(const int max_locations_distance_table)
Status TablePlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms,
const api::TableParameters &params,
util::json::Object &result) const
osrm::engine::api::ResultT &result) const
{
auto& json_result = result.get<util::json::Object>();
if (!algorithms.HasManyToManySearch())
{
return Error("NotImplemented",
@@ -154,7 +155,7 @@ Status TablePlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms,
}
api::TableAPI table_api{facade, params};
table_api.MakeResponse(result_tables_pair, snapped_phantoms, estimated_pairs, result);
table_api.MakeResponse(result_tables_pair, snapped_phantoms, estimated_pairs, json_result);
return Status::Ok;
}