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::BranchMapper Class Reference

#include <BranchMapper.h>

Inheritance diagram for edm::BranchMapper:

Public Member Functions

ProductProvenance const * branchIDToProvenance (BranchID const &bid) const
 
 BranchMapper ()
 
 BranchMapper (std::unique_ptr< ProvenanceReaderBase > reader)
 
void insertIntoSet (ProductProvenance const &provenanceProduct) const
 
void mergeMappers (boost::shared_ptr< BranchMapper > other)
 
void reset ()
 
 ~BranchMapper ()
 

Private Types

typedef std::set
< ProductProvenance
eiSet
 

Private Member Functions

void readProvenance () const
 

Private Attributes

bool delayedRead_
 
eiSet entryInfoSet_
 
boost::shared_ptr< BranchMappernextMapper_
 
boost::scoped_ptr
< ProvenanceReaderBase
provenanceReader_
 

Detailed Description

Definition at line 28 of file BranchMapper.h.

Member Typedef Documentation

typedef std::set<ProductProvenance> edm::BranchMapper::eiSet
private

Definition at line 47 of file BranchMapper.h.

Constructor & Destructor Documentation

edm::BranchMapper::BranchMapper ( )

Definition at line 12 of file BranchMapper.cc.

12  :
13  entryInfoSet_(),
14  nextMapper_(),
15  delayedRead_(false),
17  }
boost::scoped_ptr< ProvenanceReaderBase > provenanceReader_
Definition: BranchMapper.h:52
boost::shared_ptr< BranchMapper > nextMapper_
Definition: BranchMapper.h:50
edm::BranchMapper::BranchMapper ( std::unique_ptr< ProvenanceReaderBase reader)
explicit

Definition at line 19 of file BranchMapper.cc.

References provenanceReader_.

19  :
20  entryInfoSet_(),
21  nextMapper_(),
22  delayedRead_(true),
23  provenanceReader_(reader.release()) {
24  assert(provenanceReader_);
25  }
boost::scoped_ptr< ProvenanceReaderBase > provenanceReader_
Definition: BranchMapper.h:52
boost::shared_ptr< BranchMapper > nextMapper_
Definition: BranchMapper.h:50
edm::BranchMapper::~BranchMapper ( )

Definition at line 27 of file BranchMapper.cc.

27 {}

Member Function Documentation

ProductProvenance const * edm::BranchMapper::branchIDToProvenance ( BranchID const &  bid) const

Definition at line 58 of file BranchMapper.cc.

References entryInfoSet_, nextMapper_, and readProvenance().

Referenced by edm::RootOutputFile::insertAncestors().

58  {
60  ProductProvenance ei(bid);
61  eiSet::const_iterator it = entryInfoSet_.find(ei);
62  if(it == entryInfoSet_.end()) {
63  if(nextMapper_) {
64  return nextMapper_->branchIDToProvenance(bid);
65  } else {
66  return 0;
67  }
68  }
69  return &*it;
70  }
boost::shared_ptr< BranchMapper > nextMapper_
Definition: BranchMapper.h:50
void readProvenance() const
Definition: BranchMapper.cc:30
void edm::BranchMapper::insertIntoSet ( ProductProvenance const &  provenanceProduct) const

Definition at line 44 of file BranchMapper.cc.

References entryInfoSet_.

Referenced by edm::ReducedProvenanceReader::readProvenance(), edm::FullProvenanceReader::readProvenance(), and edm::OldProvenanceReader::readProvenance().

44  {
45  //NOTE:do not read provenance here because we only need the full
46  // provenance when someone tries to access it not when doing the insert
47  // doing the delay saves 20% of time when doing an analysis job
48  //readProvenance();
49  entryInfoSet_.insert(entryInfo);
50  }
void edm::BranchMapper::mergeMappers ( boost::shared_ptr< BranchMapper other)

Definition at line 53 of file BranchMapper.cc.

References nextMapper_.

53  {
54  nextMapper_ = other;
55  }
boost::shared_ptr< BranchMapper > nextMapper_
Definition: BranchMapper.h:50
void edm::BranchMapper::readProvenance ( ) const
private

Definition at line 30 of file BranchMapper.cc.

References delayedRead_, and provenanceReader_.

Referenced by branchIDToProvenance().

30  {
32  provenanceReader_->readProvenance(*this);
33  delayedRead_ = false; // only read once
34  }
35  }
boost::scoped_ptr< ProvenanceReaderBase > provenanceReader_
Definition: BranchMapper.h:52
void edm::BranchMapper::reset ( void  )

Definition at line 38 of file BranchMapper.cc.

References delayedRead_, and entryInfoSet_.

38  {
39  entryInfoSet_.clear();
40  delayedRead_ = true;
41  }

Member Data Documentation

bool edm::BranchMapper::delayedRead_
mutableprivate

Definition at line 51 of file BranchMapper.h.

Referenced by readProvenance(), and reset().

eiSet edm::BranchMapper::entryInfoSet_
mutableprivate

Definition at line 49 of file BranchMapper.h.

Referenced by branchIDToProvenance(), insertIntoSet(), and reset().

boost::shared_ptr<BranchMapper> edm::BranchMapper::nextMapper_
private

Definition at line 50 of file BranchMapper.h.

Referenced by branchIDToProvenance(), and mergeMappers().

boost::scoped_ptr<ProvenanceReaderBase> edm::BranchMapper::provenanceReader_
mutableprivate

Definition at line 52 of file BranchMapper.h.

Referenced by BranchMapper(), and readProvenance().