-
Notifications
You must be signed in to change notification settings - Fork 378
Description
There are a couple changes we could apply to the current classes describing the routing wrappers. The current Wrapper
class does not provide any real benefit over its child class RoutingWrapper
, expect that it allows to use a template parameter for Matrix
(this is not actually used).
Also, there is some code duplication in OsrmRoutedWrapper
and OrsWrapper
because they both re-implement get_matrix
and add_route_info
in the exact same way, except from subtle changes related to the way the json
data from OSRM and ORS should be parsed and handled. We could have HttpWrapper
inherit from Wrapper
and implement get_matrix
and add_route_info
. For the parts that should differ, we could call virtual member functions that would be specialized in OsrmRoutedWrapper
and OrsWrapper
.
This would make the code overall simpler and easier to re-use, especially when adding a new routing provider (#306) or applying any change to say add_route_info
(required in #303).