CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BranchChildren.h
Go to the documentation of this file.
1 #ifndef DataFormats_Provenance_BranchChildren_h
2 #define DataFormats_Provenance_BranchChildren_h
3 
4 /*----------------------------------------------------------------------
5 
6 BranchChildren: Dependency information between branches.
7 
8 ----------------------------------------------------------------------*/
9 
10 #include <map>
11 #include <set>
13 
14 namespace edm {
15 
17  private:
18  typedef std::set<BranchID> BranchIDSet;
19  typedef std::map<BranchID, BranchIDSet> map_t;
20  public:
21 
22  // Clear all information.
23  void clear();
24 
25  // Insert a parent with no children.
27 
28  // Insert a new child for the given parent.
30 
31  // Look up all the descendants of the given parent, and insert them
32  // into descendants. N.B.: this does not clear out descendants first;
33  // it only appends *new* elements to the collection.
34  void appendToDescendants(BranchID parent, BranchIDSet& descendants) const;
35 
36  // const accessor for the data
37  map_t const&
38  childLookup() const {
39  return childLookup_;
40  }
41 
42  private:
44 
45  void append_(map_t const& lookup, BranchID item, BranchIDSet& itemSet) const;
46  };
47 
48 }
49 #endif
void insertEmpty(BranchID parent)
void insertChild(BranchID parent, BranchID child)
map_t const & childLookup() const
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