Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 28 additions & 32 deletions include/engine/api/table_api.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace osrm::engine::api
class TableAPI final : public BaseAPI
{
public:
virtual ~TableAPI() = default;
~TableAPI() = default;

struct TableCellRef
{
Expand All @@ -44,11 +44,10 @@ class TableAPI final : public BaseAPI
{
}

virtual void
MakeResponse(const std::pair<std::vector<EdgeDuration>, std::vector<EdgeDistance>> &tables,
const std::vector<PhantomNodeCandidates> &candidates,
const std::vector<TableCellRef> &fallback_speed_cells,
osrm::engine::api::ResultT &response) const
void MakeResponse(const std::pair<std::vector<EdgeDuration>, std::vector<EdgeDistance>> &tables,
const std::vector<PhantomNodeCandidates> &candidates,
const std::vector<TableCellRef> &fallback_speed_cells,
osrm::engine::api::ResultT &response) const
{
if (std::holds_alternative<flatbuffers::FlatBufferBuilder>(response))
{
Expand All @@ -62,11 +61,10 @@ class TableAPI final : public BaseAPI
}
}

virtual void
MakeResponse(const std::pair<std::vector<EdgeDuration>, std::vector<EdgeDistance>> &tables,
const std::vector<PhantomNodeCandidates> &candidates,
const std::vector<TableCellRef> &fallback_speed_cells,
flatbuffers::FlatBufferBuilder &fb_result) const
void MakeResponse(const std::pair<std::vector<EdgeDuration>, std::vector<EdgeDistance>> &tables,
const std::vector<PhantomNodeCandidates> &candidates,
const std::vector<TableCellRef> &fallback_speed_cells,
flatbuffers::FlatBufferBuilder &fb_result) const
{
auto number_of_sources = parameters.sources.size();
auto number_of_destinations = parameters.destinations.size();
Expand Down Expand Up @@ -165,11 +163,10 @@ class TableAPI final : public BaseAPI
fb_result.Finish(response.Finish());
}

virtual void
MakeResponse(const std::pair<std::vector<EdgeDuration>, std::vector<EdgeDistance>> &tables,
const std::vector<PhantomNodeCandidates> &candidates,
const std::vector<TableCellRef> &fallback_speed_cells,
util::json::Object &response) const
void MakeResponse(const std::pair<std::vector<EdgeDuration>, std::vector<EdgeDistance>> &tables,
const std::vector<PhantomNodeCandidates> &candidates,
const std::vector<TableCellRef> &fallback_speed_cells,
util::json::Object &response) const
{
auto number_of_sources = parameters.sources.size();
auto number_of_destinations = parameters.destinations.size();
Expand Down Expand Up @@ -238,7 +235,7 @@ class TableAPI final : public BaseAPI
}

protected:
virtual flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<fbresult::Waypoint>>>
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<fbresult::Waypoint>>>
MakeWaypoints(flatbuffers::FlatBufferBuilder &builder,
const std::vector<PhantomNodeCandidates> &candidates) const
{
Expand All @@ -253,7 +250,7 @@ class TableAPI final : public BaseAPI
return builder.CreateVector(waypoints);
}

virtual flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<fbresult::Waypoint>>>
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<fbresult::Waypoint>>>
MakeWaypoints(flatbuffers::FlatBufferBuilder &builder,
const std::vector<PhantomNodeCandidates> &candidates,
const std::vector<std::size_t> &indices) const
Expand All @@ -271,7 +268,7 @@ class TableAPI final : public BaseAPI
return builder.CreateVector(waypoints);
}

virtual flatbuffers::Offset<flatbuffers::Vector<float>>
flatbuffers::Offset<flatbuffers::Vector<float>>
MakeDurationTable(flatbuffers::FlatBufferBuilder &builder,
const std::vector<EdgeDuration> &values) const
{
Expand All @@ -291,7 +288,7 @@ class TableAPI final : public BaseAPI
return builder.CreateVector(distance_table);
}

virtual flatbuffers::Offset<flatbuffers::Vector<float>>
flatbuffers::Offset<flatbuffers::Vector<float>>
MakeDistanceTable(flatbuffers::FlatBufferBuilder &builder,
const std::vector<EdgeDistance> &values) const
{
Expand All @@ -311,7 +308,7 @@ class TableAPI final : public BaseAPI
return builder.CreateVector(duration_table);
}

virtual flatbuffers::Offset<flatbuffers::Vector<uint32_t>>
flatbuffers::Offset<flatbuffers::Vector<uint32_t>>
MakeEstimatesTable(flatbuffers::FlatBufferBuilder &builder,
const std::vector<TableCellRef> &fallback_speed_cells) const
{
Expand All @@ -327,8 +324,7 @@ class TableAPI final : public BaseAPI
return builder.CreateVector(fb_table);
}

virtual util::json::Array
MakeWaypoints(const std::vector<PhantomNodeCandidates> &candidates) const
util::json::Array MakeWaypoints(const std::vector<PhantomNodeCandidates> &candidates) const
{
util::json::Array json_waypoints;
json_waypoints.values.reserve(candidates.size());
Expand All @@ -341,8 +337,8 @@ class TableAPI final : public BaseAPI
return json_waypoints;
}

virtual util::json::Array MakeWaypoints(const std::vector<PhantomNodeCandidates> &candidates,
const std::vector<std::size_t> &indices) const
util::json::Array MakeWaypoints(const std::vector<PhantomNodeCandidates> &candidates,
const std::vector<std::size_t> &indices) const
{
util::json::Array json_waypoints;
json_waypoints.values.reserve(indices.size());
Expand All @@ -356,9 +352,9 @@ class TableAPI final : public BaseAPI
return json_waypoints;
}

virtual util::json::Array MakeDurationTable(const std::vector<EdgeDuration> &values,
std::size_t number_of_rows,
std::size_t number_of_columns) const
util::json::Array MakeDurationTable(const std::vector<EdgeDuration> &values,
std::size_t number_of_rows,
std::size_t number_of_columns) const
{
util::json::Array json_table;
for (const auto row : util::irange<std::size_t>(0UL, number_of_rows))
Expand Down Expand Up @@ -386,9 +382,9 @@ class TableAPI final : public BaseAPI
return json_table;
}

virtual util::json::Array MakeDistanceTable(const std::vector<EdgeDistance> &values,
std::size_t number_of_rows,
std::size_t number_of_columns) const
util::json::Array MakeDistanceTable(const std::vector<EdgeDistance> &values,
std::size_t number_of_rows,
std::size_t number_of_columns) const
{
util::json::Array json_table;
for (const auto row : util::irange<std::size_t>(0UL, number_of_rows))
Expand All @@ -415,7 +411,7 @@ class TableAPI final : public BaseAPI
return json_table;
}

virtual util::json::Array
util::json::Array
MakeEstimatesTable(const std::vector<TableCellRef> &fallback_speed_cells) const
{
util::json::Array json_table;
Expand Down
Loading