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

Method RestrictionLoader

libs/routing/restriction_loader.cpp:54–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52namespace routing
53{
54RestrictionLoader::RestrictionLoader(MwmValue const & mwmValue, IndexGraph & graph)
55 : m_countryFileName(mwmValue.GetCountryFileName())
56{
57 if (!mwmValue.m_cont.IsExist(RESTRICTIONS_FILE_TAG))
58 return;
59
60 try
61 {
62 m_reader = std::make_unique<FilesContainerR::TReader>(mwmValue.m_cont.GetReader(RESTRICTIONS_FILE_TAG));
63 ReaderSource<FilesContainerR::TReader> src(*m_reader);
64 m_header.Deserialize(src);
65
66 RestrictionVec restrictionsOnly;
67 std::vector<RestrictionUTurn> restrictionsOnlyUTurn;
68 RestrictionSerializer::Deserialize(m_header, m_restrictions /* restriction No, without no_u_turn */,
69 restrictionsOnly, m_noUTurnRestrictions, restrictionsOnlyUTurn, src);
70
71 ConvertRestrictionsOnlyToNo(graph, restrictionsOnly, m_restrictions);
72 ConvertRestrictionsOnlyUTurnToNo(graph, restrictionsOnlyUTurn, m_restrictions);
73 }
74 catch (Reader::OpenException const & e)
75 {
76 m_header.Reset();
77 LOG(LERROR, ("File", m_countryFileName, "Error while reading", RESTRICTIONS_FILE_TAG, "section.", e.Msg()));
78 throw;
79 }
80}
81
82bool RestrictionLoader::HasRestrictions() const
83{

Callers

nothing calls this directly

Calls 7

GetCountryFileNameMethod · 0.80
IsExistMethod · 0.80
GetReaderMethod · 0.45
DeserializeMethod · 0.45
ResetMethod · 0.45

Tested by

no test coverage detected