CMS 3D CMS Logo

Public Member Functions | Private Types | Private Member Functions | Private Attributes

edm::BranchChildren Class Reference

#include <BranchChildren.h>

List of all members.

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().

                                                                                        {
    BranchIDSet const& items = const_cast<map_t &>(lookup)[item];
    // For each parent(child)
    for (BranchIDSet::const_iterator ci = items.begin(), ce = items.end();
        ci != ce; ++ci) {
      // Insert the BranchID of the parents(children) into the set of ancestors(descendants).
      // If the insert succeeds, append recursively.
      if (itemSet.insert(*ci).second) {
        append_(lookup, *ci, itemSet);
      }
    }
  }
void edm::BranchChildren::appendToDescendants ( BranchID  parent,
BranchIDSet descendants 
) const

Definition at line 34 of file BranchChildren.cc.

References append_(), and childLookup_.

                                                                                     {
    descendants.insert(parent);
    append_(childLookup_, parent, descendants);
  }
map_t const& edm::BranchChildren::childLookup ( ) const [inline]

Definition at line 38 of file BranchChildren.h.

References childLookup_.

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

                        {
      return childLookup_;
    }
void edm::BranchChildren::clear ( void  )

Definition at line 19 of file BranchChildren.cc.

References childLookup_.

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

                        {
    childLookup_.clear();
  }
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().

                                                             {
    childLookup_[parent].insert(child);
  }
void edm::BranchChildren::insertEmpty ( BranchID  parent)

Definition at line 24 of file BranchChildren.cc.

References childLookup_.

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

                                             {
    childLookup_.insert(std::make_pair(parent, BranchIDSet()));
  }

Member Data Documentation

Definition at line 43 of file BranchChildren.h.

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