CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BranchChildren.cc
Go to the documentation of this file.
2 
3 namespace edm {
4  void
5  BranchChildren::append_(map_t const& lookup, BranchID item, BranchIDSet& itemSet) const {
6  auto const iter = lookup.find(item);
7  if(iter != lookup.end()) {
8  BranchIDSet const& branchIDs = iter->second;
9  for(BranchID const& branchID : branchIDs) {
10  // Insert the BranchID of the parents(children) into the set of ancestors(descendants).
11  // If the insert succeeds, append recursively.
12  if(itemSet.insert(branchID).second) {
13  append_(lookup, branchID, itemSet);
14  }
15  }
16  }
17  }
18 
19  void
21  childLookup_.clear();
22  }
23 
24  void
26  childLookup_.insert(std::make_pair(parent, BranchIDSet()));
27  }
28 
29  void
31  childLookup_[parent].insert(child);
32  }
33 
34  void
36  descendants.insert(parent);
37  append_(childLookup_, parent, descendants);
38  }
39 }
list parent
Definition: dbtoconf.py:74
void insertEmpty(BranchID parent)
void insertChild(BranchID parent, BranchID child)
std::set< BranchID > BranchIDSet
void append_(map_t const &lookup, BranchID item, BranchIDSet &itemSet) const
std::map< BranchID, BranchIDSet > map_t
void appendToDescendants(BranchID parent, BranchIDSet &descendants) const