You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
The text was updated successfully, but these errors were encountered:
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 classRoutingWrapper
, expect that it allows to use a template parameter forMatrix
(this is not actually used).Also, there is some code duplication in
OsrmRoutedWrapper
andOrsWrapper
because they both re-implementget_matrix
andadd_route_info
in the exact same way, except from subtle changes related to the way thejson
data from OSRM and ORS should be parsed and handled. We could haveHttpWrapper
inherit fromWrapper
and implementget_matrix
andadd_route_info
. For the parts that should differ, we could call virtual member functions that would be specialized inOsrmRoutedWrapper
andOrsWrapper
.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).The text was updated successfully, but these errors were encountered: