Project-OSRM / osrm-backend

Open Source Routing Machine - C++ backend
http://map.project-osrm.org
BSD 2-Clause "Simplified" License
6.26k stars 3.31k forks source link

Datafacades assume data layout is in a contiguous memory block #4158

Closed danpat closed 2 weeks ago

danpat commented 7 years ago

Currently, it is only possible to implement alternative datafacades using the all-in-one-block structure described by the ContiguousInternalMemoryDatafacade.

If someone would want to implement an alternative storage approach - e.g. keeping data in individual files and mmap()-ing them, then our current inheritance structure makes this impossible - the algorithm-specific classes assume they're based on the ContiguousInternalMemoryDatafacade rather than the BaseDatafacade.

We should refactor this so that alternative storage can be implemented without needing to re-write the algorithm-specific subclasses.

TheMarex commented 7 years ago

I talked with @oxidase about this yesterday a little bit an we concluded the best option here would be a compile time switch, since we don't need the flexibility of switching this at run-time.

There are two methods to do this:

  1. Go full template. This is undesirable on multiple levels and chances are we would never use this functionality.
  2. Compile-time switch using a type alias. For external embedders of OSRM this should work just as well.
github-actions[bot] commented 1 month ago

This issue seems to be stale. It will be closed in 30 days if no further activity occurs.