Add abstraction to change the data facade at compile time

This commit is contained in:
Patrick Niklaus
2017-07-13 13:05:08 +00:00
committed by Patrick Niklaus
parent b2ed46efb5
commit 49f0b1eb59
33 changed files with 267 additions and 275 deletions
+4 -7
View File
@@ -230,10 +230,7 @@ FixedPoint coordinatesToTilePoint(const util::Coordinate point, const BBox &tile
return FixedPoint{px, py};
}
std::vector<RTreeLeaf> getEdges(const datafacade::ContiguousInternalMemoryDataFacadeBase &facade,
unsigned x,
unsigned y,
unsigned z)
std::vector<RTreeLeaf> getEdges(const DataFacadeBase &facade, unsigned x, unsigned y, unsigned z)
{
double min_lon, min_lat, max_lon, max_lat;
@@ -274,7 +271,7 @@ std::vector<std::size_t> getEdgeIndex(const std::vector<RTreeLeaf> &edges)
return sorted_edge_indexes;
}
void encodeVectorTile(const datafacade::ContiguousInternalMemoryDataFacadeBase &facade,
void encodeVectorTile(const DataFacadeBase &facade,
unsigned x,
unsigned y,
unsigned z,
@@ -882,13 +879,13 @@ void encodeVectorTile(const datafacade::ContiguousInternalMemoryDataFacadeBase &
}
}
Status TilePlugin::HandleRequest(const datafacade::ContiguousInternalMemoryDataFacadeBase &facade,
const RoutingAlgorithmsInterface &algorithms,
Status TilePlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms,
const api::TileParameters &parameters,
std::string &pbf_buffer) const
{
BOOST_ASSERT(parameters.IsValid());
const auto &facade = algorithms.GetFacade();
auto edges = getEdges(facade, parameters.x, parameters.y, parameters.z);
auto edge_index = getEdgeIndex(edges);