MCPcopy Create free account
hub / github.com/comaps/comaps / GetSpeedGroup

Method GetSpeedGroup

libs/routing/traffic_stash.cpp:27–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27traffic::SpeedGroup TrafficStash::GetSpeedGroup(Segment const & segment) const
28{
29 auto itMwm = m_mwmToTraffic.find(segment.GetMwmId());
30 if (itMwm == m_mwmToTraffic.cend())
31 return traffic::SpeedGroup::Unknown;
32
33 auto const & coloring = itMwm->second;
34 auto const itSeg = coloring->find(traffic::TrafficInfo::RoadSegmentId(
35 segment.GetFeatureId(), base::asserted_cast<uint16_t>(segment.GetSegmentIdx()),
36 segment.IsForward() ? traffic::TrafficInfo::RoadSegmentId::kForwardDirection
37 : traffic::TrafficInfo::RoadSegmentId::kReverseDirection));
38
39 if (itSeg == coloring->cend())
40 return traffic::SpeedGroup::Unknown;
41
42 return itSeg->second;
43}
44
45void TrafficStash::SetColoring(NumMwmId numMwmId, shared_ptr<traffic::TrafficInfo::Coloring const> coloring)
46{

Callers 2

CalcSegmentWeightMethod · 0.45
RedressRouteMethod · 0.45

Calls 7

RoadSegmentIdClass · 0.85
findMethod · 0.45
GetMwmIdMethod · 0.45
cendMethod · 0.45
GetFeatureIdMethod · 0.45
GetSegmentIdxMethod · 0.45
IsForwardMethod · 0.45

Tested by

no test coverage detected