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  BranchIDSet const& items = const_cast<map_t &>(lookup)[item];
7  // For each parent(child)
8  for (BranchIDSet::const_iterator ci = items.begin(), ce = items.end();
9  ci != ce; ++ci) {
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(*ci).second) {
13  append_(lookup, *ci, itemSet);
14  }
15  }
16  }
std::set< BranchID > BranchIDSet
void append_(map_t const &lookup, BranchID item, BranchIDSet &itemSet) const
std::map< BranchID, BranchIDSet > map_t
void edm::BranchChildren::appendToDescendants ( BranchID  parent,
BranchIDSet descendants 
) const

Definition at line 34 of file BranchChildren.cc.

References append_(), and childLookup_.

34  {
35  descendants.insert(parent);
36  append_(childLookup_, parent, descendants);
37  }
list parent
Definition: dbtoconf.py:74
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 29 of file BranchChildren.cc.

References childLookup_, and dbtoconf::parent.

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

29  {
30  childLookup_[parent].insert(child);
31  }
list parent
Definition: dbtoconf.py:74
void edm::BranchChildren::insertEmpty ( BranchID  parent)

Definition at line 24 of file BranchChildren.cc.

References childLookup_.

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

24  {
25  childLookup_.insert(std::make_pair(parent, BranchIDSet()));
26  }
list parent
Definition: dbtoconf.py:74
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().