CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
edm::BranchChildren Class Reference

#include <BranchChildren.h>

Public Member Functions

void appendToDescendants (BranchID parent, BranchIDSet &descendants) const
 
map_t const & childLookup () const
 
void clear ()
 
void insertChild (BranchID parent, BranchID child)
 
void insertEmpty (BranchID parent)
 

Private Types

typedef std::set< BranchIDBranchIDSet
 
typedef std::map< BranchID,
BranchIDSet
map_t
 

Private Member Functions

void append_ (map_t const &lookup, BranchID item, BranchIDSet &itemSet) const
 

Private Attributes

map_t childLookup_
 

Detailed Description

Definition at line 16 of file BranchChildren.h.

Member Typedef Documentation

typedef std::set<BranchID> edm::BranchChildren::BranchIDSet
private

Definition at line 18 of file BranchChildren.h.

typedef std::map<BranchID, BranchIDSet> edm::BranchChildren::map_t
private

Definition at line 19 of file BranchChildren.h.

Member Function Documentation

void edm::BranchChildren::append_ ( map_t const &  lookup,
BranchID  item,
BranchIDSet itemSet 
) const
private

Definition at line 5 of file BranchChildren.cc.

Referenced by appendToDescendants().

5  {
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  }
std::set< BranchID > BranchIDSet
void append_(map_t const &lookup, BranchID item, BranchIDSet &itemSet) const
void edm::BranchChildren::appendToDescendants ( BranchID  parent,
BranchIDSet descendants 
) const

Definition at line 35 of file BranchChildren.cc.

References append_(), and childLookup_.

35  {
36  descendants.insert(parent);
37  append_(childLookup_, parent, descendants);
38  }
parent
Definition: confdb.py:1052
void append_(map_t const &lookup, BranchID item, BranchIDSet &itemSet) const
map_t const& edm::BranchChildren::childLookup ( ) const
inline

Definition at line 38 of file BranchChildren.h.

References childLookup_.

Referenced by edm::DaqProvenanceHelper::fixMetaData().

38  {
39  return childLookup_;
40  }
void edm::BranchChildren::clear ( void  )
void edm::BranchChildren::insertChild ( BranchID  parent,
BranchID  child 
)

Definition at line 30 of file BranchChildren.cc.

References childLookup_, and confdb::parent.

Referenced by edm::PoolOutputModule::fillDependencyGraph().

30  {
31  childLookup_[parent].insert(child);
32  }
parent
Definition: confdb.py:1052
void edm::BranchChildren::insertEmpty ( BranchID  parent)

Definition at line 25 of file BranchChildren.cc.

References childLookup_.

Referenced by edm::PoolOutputModule::updateBranchParents().

25  {
26  childLookup_.insert(std::make_pair(parent, BranchIDSet()));
27  }
parent
Definition: confdb.py:1052
std::set< BranchID > BranchIDSet

Member Data Documentation

map_t edm::BranchChildren::childLookup_
private

Definition at line 43 of file BranchChildren.h.

Referenced by appendToDescendants(), childLookup(), clear(), insertChild(), and insertEmpty().