[routing] Enable access conditional.

Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
(cherry picked from commit 6a2f2662b334345dc8789e970f358cec3ed69c85)
This commit is contained in:
Viktor Govako
2025-10-27 20:29:09 -03:00
committed by Konstantin Pastbin
parent 3352fc13c1
commit ffcb694961
20 changed files with 311 additions and 266 deletions

View File

@@ -30,8 +30,8 @@ class IndexGraphLoaderImpl final : public IndexGraphLoader
public:
IndexGraphLoaderImpl(VehicleType vehicleType, bool loadAltitudes,
shared_ptr<VehicleModelFactoryInterface> vehicleModelFactory,
shared_ptr<EdgeEstimator> estimator, MwmDataSource & dataSource,
RoutingOptions routingOptions = RoutingOptions())
shared_ptr<EdgeEstimator> estimator, MwmDataSource & dataSource, RoutingOptions routingOptions,
TimeGetterT timeGetter)
: m_vehicleType(vehicleType)
, m_loadAltitudes(loadAltitudes)
, m_dataSource(dataSource)
@@ -41,6 +41,9 @@ public:
{
CHECK(m_vehicleModelFactory, ());
CHECK(m_estimator, ());
if (timeGetter)
m_currentTimeGetter = std::move(timeGetter);
}
// IndexGraphLoader overrides:
@@ -249,10 +252,10 @@ bool ReadRoadPenaltyFromMwm(MwmValue const & mwmValue, VehicleType vehicleType,
unique_ptr<IndexGraphLoader> IndexGraphLoader::Create(VehicleType vehicleType, bool loadAltitudes,
shared_ptr<VehicleModelFactoryInterface> vehicleModelFactory,
shared_ptr<EdgeEstimator> estimator, MwmDataSource & dataSource,
RoutingOptions routingOptions)
RoutingOptions routingOptions, TimeGetterT timeGetter)
{
return make_unique<IndexGraphLoaderImpl>(vehicleType, loadAltitudes, vehicleModelFactory, estimator, dataSource,
routingOptions);
routingOptions, std::move(timeGetter));
}
void DeserializeIndexGraph(MwmValue const & mwmValue, VehicleType vehicleType, IndexGraph & graph)