diff --git a/routing/dummy_world_graph.hpp b/routing/dummy_world_graph.hpp new file mode 100644 index 0000000000..8da0e0c9f5 --- /dev/null +++ b/routing/dummy_world_graph.hpp @@ -0,0 +1,118 @@ +#pragma once + +#include "routing/latlon_with_altitude.hpp" +#include "routing/world_graph.hpp" + +#include "geometry/latlon.hpp" + +#include "base/assert.hpp" + +#include +#include +#include +#include + +namespace routing +{ +// This is dummy class inherited from WorldGraph. Some of its overridden methods should never be +// called. This class is used in RegionsRouter as a lightweight replacement of +// SingleVehicleWorldGraph. +class DummyWorldGraph final : public WorldGraph +{ +public: + using WorldGraph::GetEdgeList; + + void GetEdgeList(astar::VertexData const & vertexData, bool isOutgoing, + bool useRoutingOptions, bool useAccessConditional, + std::vector & edges) override + { + UNREACHABLE(); + } + + void GetEdgeList(astar::VertexData const & vertexData, + Segment const & segment, bool isOutgoing, bool useAccessConditional, + std::vector & edges, + std::vector & parentWeights) override + { + UNREACHABLE(); + } + + bool CheckLength(RouteWeight const & weight, double startToFinishDistanceM) const override + { + return true; + } + + LatLonWithAltitude const & GetJunction(Segment const & segment, bool front) override + { + UNREACHABLE(); + } + + ms::LatLon const & GetPoint(Segment const & segment, bool front) override + { + UNREACHABLE(); + } + + bool IsOneWay(NumMwmId mwmId, uint32_t featureId) override + { + UNREACHABLE(); + } + + bool IsPassThroughAllowed(NumMwmId mwmId, uint32_t featureId) override + { + UNREACHABLE(); + } + + void ClearCachedGraphs() override { UNREACHABLE(); } + + void SetMode(WorldGraphMode mode) override {} + + WorldGraphMode GetMode() const override { return WorldGraphMode::NoLeaps; } + + RouteWeight HeuristicCostEstimate(ms::LatLon const & from, ms::LatLon const & to) override + { + return RouteWeight(); + } + + RouteWeight CalcSegmentWeight(Segment const & segment, EdgeEstimator::Purpose purpose) override + { + UNREACHABLE(); + } + + RouteWeight CalcLeapWeight(ms::LatLon const & from, ms::LatLon const & to) const override + { + UNREACHABLE(); + } + + RouteWeight CalcOffroadWeight(ms::LatLon const & from, ms::LatLon const & to, + EdgeEstimator::Purpose purpose) const override + { + return RouteWeight(); + } + + double CalculateETA(Segment const & from, Segment const & to) override + { + UNREACHABLE(); + } + + double CalculateETAWithoutPenalty(Segment const & segment) override + { + UNREACHABLE(); + } + + std::unique_ptr GetTransitInfo(Segment const & segment) override + { + UNREACHABLE(); + } + + IndexGraph & GetIndexGraph(NumMwmId numMwmId) override + { + UNREACHABLE(); + } + + void GetTwinsInner(Segment const & segment, bool isOutgoing, + std::vector & twins) override + { + CHECK(false, ()); + } +}; +} // namespace routing