| 20 | RoadInfoGetter::RoadInfoGetter(DataSource const & dataSource) : m_dataSource(dataSource) {} |
| 21 | |
| 22 | RoadInfoGetter::RoadInfo RoadInfoGetter::Get(FeatureID const & fid) |
| 23 | { |
| 24 | auto it = m_cache.find(fid); |
| 25 | if (it != end(m_cache)) |
| 26 | return it->second; |
| 27 | |
| 28 | FeaturesLoaderGuard g(m_dataSource, fid.m_mwmId); |
| 29 | auto ft = g.GetOriginalFeatureByIndex(fid.m_index); |
| 30 | CHECK(ft, ()); |
| 31 | |
| 32 | RoadInfo info(*ft); |
| 33 | it = m_cache.emplace(fid, info).first; |
| 34 | |
| 35 | return it->second; |
| 36 | } |
| 37 | } // namespace openlr |
no test coverage detected