Added flatbuffers support to the PluginBase::Error
This changes BREAKS osrm.
This commit is contained in:
@@ -33,7 +33,6 @@ Status TablePlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms,
|
||||
const api::TableParameters ¶ms,
|
||||
osrm::engine::api::ResultT &result) const
|
||||
{
|
||||
auto& json_result = result.get<util::json::Object>();
|
||||
if (!algorithms.HasManyToManySearch())
|
||||
{
|
||||
return Error("NotImplemented",
|
||||
@@ -155,6 +154,7 @@ Status TablePlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms,
|
||||
}
|
||||
|
||||
api::TableAPI table_api{facade, params};
|
||||
auto& json_result = result.get<util::json::Object>();
|
||||
table_api.MakeResponse(result_tables_pair, snapped_phantoms, estimated_pairs, json_result);
|
||||
|
||||
return Status::Ok;
|
||||
|
||||
@@ -97,6 +97,12 @@ TableService::RunQuery(std::size_t prefix_length, std::string &query, osrm::engi
|
||||
}
|
||||
BOOST_ASSERT(parameters->IsValid());
|
||||
|
||||
if (parameters->format)
|
||||
{
|
||||
if (parameters->format == engine::api::BaseParameters::OutputFormatType::FLATBUFFERS) {
|
||||
result = flatbuffers::FlatBufferBuilder();
|
||||
}
|
||||
}
|
||||
return BaseService::routing_machine.Table(*parameters, result);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user