blob: 43e8f6d88191cac3a0606c4cf1f28c0ee4aabafa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
#pragma once
#include "routing/index_graph_starter.hpp"
#include "routing/road_graph.hpp"
#include "routing/segment.hpp"
#include "routing_common/num_mwm_id.hpp"
#include "indexer/data_source.hpp"
#include <map>
#include <memory>
#include <vector>
namespace routing
{
class IndexRoadGraph : public RoadGraphBase
{
public:
IndexRoadGraph(std::shared_ptr<NumMwmIds> numMwmIds, IndexGraphStarter & starter,
std::vector<Segment> const & segments, std::vector<Junction> const & junctions,
DataSourceBase & dataSource);
// IRoadGraphBase overrides:
virtual void GetOutgoingEdges(Junction const & junction, TEdgeVector & edges) const override;
virtual void GetIngoingEdges(Junction const & junction, TEdgeVector & edges) const override;
virtual double GetMaxSpeedKMPH() const override;
virtual void GetEdgeTypes(Edge const & edge, feature::TypesHolder & types) const override;
virtual void GetJunctionTypes(Junction const & junction,
feature::TypesHolder & types) const override;
virtual void GetRouteEdges(TEdgeVector & edges) const override;
virtual void GetRouteSegments(std::vector<Segment> & segments) const override;
private:
void GetEdges(Junction const & junction, bool isOutgoing, TEdgeVector & edges) const;
std::vector<Segment> const & GetSegments(Junction const & junction, bool isOutgoing) const;
DataSourceBase & m_dataSource;
std::shared_ptr<NumMwmIds> m_numMwmIds;
IndexGraphStarter & m_starter;
std::vector<Segment> m_segments;
std::map<Junction, std::vector<Segment>> m_beginToSegment;
std::map<Junction, std::vector<Segment>> m_endToSegment;
};
} // namespace routing
|