Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Routing classes improvement #320

Closed
jcoupey opened this issue Apr 12, 2020 · 0 comments · Fixed by #321
Closed

Routing classes improvement #320

jcoupey opened this issue Apr 12, 2020 · 0 comments · Fixed by #321

Comments

@jcoupey
Copy link
Collaborator

jcoupey commented Apr 12, 2020

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant