| 739 | |
| 740 | template <class ToDo> |
| 741 | void Storage::ForEachInSubtree(CountryId const & root, ToDo && toDo) const |
| 742 | { |
| 743 | CountryTree::Node const * const rootNode = m_countries.FindFirst(root); |
| 744 | if (rootNode == nullptr) |
| 745 | { |
| 746 | ASSERT(false, ("CountryId =", root, "not found in m_countries.")); |
| 747 | return; |
| 748 | } |
| 749 | rootNode->ForEachInSubtree([&toDo](CountryTree::Node const & node) |
| 750 | { |
| 751 | Country const & value = node.Value(); |
| 752 | toDo(value.Name(), value.GetSubtreeMwmCounter() != 1 /* groupNode. */); |
| 753 | }); |
| 754 | } |
| 755 | |
| 756 | /// Calls functor |toDo| with signature |
| 757 | /// void(const CountryId const & parentId, CountriesVec const & descendantCountryId) |