LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
art::BranchChildren Class Reference

#include "BranchChildren.h"

Public Types

using map_t = std::map< ProductID, ProductIDSet >
 

Public Member Functions

void clear ()
 
void insertEmpty (ProductID parent)
 
void insertChild (ProductID parent, ProductID child)
 
void appendToDescendants (ProductID parent, ProductIDSet &descendants) const
 

Private Types

using ProductIDSet = std::set< ProductID >
 

Private Member Functions

void append_ (map_t const &lookup, ProductID item, ProductIDSet &itemSet) const
 

Private Attributes

map_t childLookup_
 

Detailed Description

Definition at line 17 of file BranchChildren.h.

Member Typedef Documentation

Definition at line 38 of file BranchChildren.h.

using art::BranchChildren::ProductIDSet = std::set<ProductID>
private

Definition at line 19 of file BranchChildren.h.

Member Function Documentation

void art::BranchChildren::append_ ( map_t const &  lookup,
ProductID  item,
ProductIDSet itemSet 
) const
private

Definition at line 8 of file BranchChildren.cc.

Referenced by appendToDescendants().

11  {
12  auto const& items = const_cast<map_t&>(lookup)[item];
13  // For each parent(child)
14  for (auto const& i : items) {
15  // Insert the ProductID of the parents (children) into the set
16  // of ancestors (descendants). If the insert succeeds, append
17  // recursively.
18  if (itemSet.insert(i).second) {
19  append_(lookup, i, itemSet);
20  }
21  }
22  }
void append_(map_t const &lookup, ProductID item, ProductIDSet &itemSet) const
std::map< ProductID, ProductIDSet > map_t
void art::BranchChildren::appendToDescendants ( ProductID  parent,
ProductIDSet descendants 
) const

Definition at line 43 of file BranchChildren.cc.

References append_(), and childLookup_.

Referenced by art::RootInputFile::dropOnInput().

45  {
46  descendants.insert(parent);
47  append_(childLookup_, parent, descendants);
48  }
void append_(map_t const &lookup, ProductID item, ProductIDSet &itemSet) const
void art::BranchChildren::clear ( void  )

Definition at line 25 of file BranchChildren.cc.

References childLookup_.

Referenced by art::OutputModule::reallyCloseFile().

26  {
27  childLookup_.clear();
28  }
void art::BranchChildren::insertChild ( ProductID  parent,
ProductID  child 
)

Definition at line 37 of file BranchChildren.cc.

References childLookup_.

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

38  {
39  childLookup_[parent].insert(child);
40  }
void art::BranchChildren::insertEmpty ( ProductID  parent)

Definition at line 31 of file BranchChildren.cc.

References childLookup_.

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

32  {
33  childLookup_.emplace(parent, ProductIDSet{});
34  }
std::set< ProductID > ProductIDSet

Member Data Documentation

map_t art::BranchChildren::childLookup_
private

Definition at line 41 of file BranchChildren.h.

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


The documentation for this class was generated from the following files: