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:
edm::BranchMapperWithReader

Public Member Functions

boost::shared_ptr
< ProductProvenance
branchIDToProvenance (BranchID const &bid) const
 
 BranchMapper ()
 
 BranchMapper (bool delayedRead)
 
void insert (ProductProvenance const &provenanceProduct)
 
void mergeMappers (boost::shared_ptr< BranchMapper > other)
 
BranchID oldProductIDToBranchID (ProductID const &oldProductID) const
 
ProcessHistoryID const & processHistoryID () const
 
ProcessHistoryIDprocessHistoryID ()
 
void setDelayedRead (bool value)
 
void write (std::ostream &os) const
 
virtual ~BranchMapper ()
 

Private Types

typedef std::set
< ProductProvenance
eiSet
 

Private Member Functions

virtual BranchID oldProductIDToBranchID_ (ProductID const &oldProductID) const
 
void readProvenance () const
 
virtual void readProvenance_ () const
 

Private Attributes

bool delayedRead_
 
eiSet entryInfoSet_
 
boost::shared_ptr< BranchMappernextMapper_
 
ProcessHistoryID processHistoryID_
 

Detailed Description

Definition at line 26 of file BranchMapper.h.

Member Typedef Documentation

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

Definition at line 53 of file BranchMapper.h.

Constructor & Destructor Documentation

edm::BranchMapper::BranchMapper ( )

Definition at line 10 of file BranchMapper.cc.

10  :
11  entryInfoSet_(),
12  nextMapper_(),
13  delayedRead_(false),
15  { }
ProcessHistoryID processHistoryID_
Definition: BranchMapper.h:66
boost::shared_ptr< BranchMapper > nextMapper_
Definition: BranchMapper.h:62
edm::BranchMapper::BranchMapper ( bool  delayedRead)
explicit

Definition at line 17 of file BranchMapper.cc.

17  :
18  entryInfoSet_(),
19  nextMapper_(),
20  delayedRead_(delayedRead),
22  { }
ProcessHistoryID processHistoryID_
Definition: BranchMapper.h:66
boost::shared_ptr< BranchMapper > nextMapper_
Definition: BranchMapper.h:62
edm::BranchMapper::~BranchMapper ( )
virtual

Definition at line 24 of file BranchMapper.cc.

24 {}

Member Function Documentation

boost::shared_ptr< ProductProvenance > edm::BranchMapper::branchIDToProvenance ( BranchID const &  bid) const

Definition at line 44 of file BranchMapper.cc.

References entryInfoSet_, nextMapper_, and readProvenance().

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

44  {
46  ProductProvenance ei(bid);
47  eiSet::const_iterator it = entryInfoSet_.find(ei);
48  if (it == entryInfoSet_.end()) {
49  if (nextMapper_) {
50  return nextMapper_->branchIDToProvenance(bid);
51  } else {
52  return boost::shared_ptr<ProductProvenance>();
53  }
54  }
55  return boost::shared_ptr<ProductProvenance>(new ProductProvenance(*it));
56  }
boost::shared_ptr< BranchMapper > nextMapper_
Definition: BranchMapper.h:62
void readProvenance() const
Definition: BranchMapper.cc:27
void edm::BranchMapper::insert ( ProductProvenance const &  provenanceProduct)

Definition at line 35 of file BranchMapper.cc.

References entryInfoSet_.

Referenced by edm::BranchMapperWithReader::readProvenance_().

35  {
36  //NOTE:do not read provenance here because we only need the full
37  // provenance when someone tries to access it not when doing the insert
38  // doing the delay saves 20% of time when doing an analysis job
39  //readProvenance();
40  entryInfoSet_.insert(entryInfo);
41  }
void edm::BranchMapper::mergeMappers ( boost::shared_ptr< BranchMapper other)
inline

Definition at line 40 of file BranchMapper.h.

References nextMapper_.

40 {nextMapper_ = other;}
boost::shared_ptr< BranchMapper > nextMapper_
Definition: BranchMapper.h:62
BranchID edm::BranchMapper::oldProductIDToBranchID ( ProductID const &  oldProductID) const
inline

Definition at line 44 of file BranchMapper.h.

References oldProductIDToBranchID_().

44  {
45  return oldProductIDToBranchID_(oldProductID);
46  }
virtual BranchID oldProductIDToBranchID_(ProductID const &oldProductID) const
Definition: BranchMapper.cc:59
BranchID edm::BranchMapper::oldProductIDToBranchID_ ( ProductID const &  oldProductID) const
privatevirtual

Reimplemented in edm::BranchMapperWithReader.

Definition at line 59 of file BranchMapper.cc.

References edm::hlt::Exception, and edm::errors::LogicError.

Referenced by oldProductIDToBranchID().

59  {
61  << "Internal error: Illegal call of oldProductIDToBranchID_.\n"
62  << "Please report this error to the Framework group\n";
63  }
ProcessHistoryID const& edm::BranchMapper::processHistoryID ( ) const
inline

Definition at line 48 of file BranchMapper.h.

References processHistoryID_.

48 {return processHistoryID_;}
ProcessHistoryID processHistoryID_
Definition: BranchMapper.h:66
ProcessHistoryID& edm::BranchMapper::processHistoryID ( )
inline

Definition at line 50 of file BranchMapper.h.

References processHistoryID_.

50 {return processHistoryID_;}
ProcessHistoryID processHistoryID_
Definition: BranchMapper.h:66
void edm::BranchMapper::readProvenance ( ) const
private

Definition at line 27 of file BranchMapper.cc.

References delayedRead_, and readProvenance_().

Referenced by branchIDToProvenance().

27  {
28  if (delayedRead_) {
29  delayedRead_ = false;
31  }
32  }
virtual void readProvenance_() const
Definition: BranchMapper.h:56
virtual void edm::BranchMapper::readProvenance_ ( ) const
inlineprivatevirtual

Reimplemented in edm::BranchMapperWithReader.

Definition at line 56 of file BranchMapper.h.

Referenced by readProvenance().

56 {}
void edm::BranchMapper::setDelayedRead ( bool  value)
inline

Definition at line 42 of file BranchMapper.h.

References delayedRead_, and relativeConstraints::value.

void edm::BranchMapper::write ( std::ostream &  os) const

Referenced by edm::operator<<().

Member Data Documentation

bool edm::BranchMapper::delayedRead_
mutableprivate

Definition at line 64 of file BranchMapper.h.

Referenced by readProvenance(), and setDelayedRead().

eiSet edm::BranchMapper::entryInfoSet_
private

Definition at line 60 of file BranchMapper.h.

Referenced by branchIDToProvenance(), and insert().

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

Definition at line 62 of file BranchMapper.h.

Referenced by branchIDToProvenance(), and mergeMappers().

ProcessHistoryID edm::BranchMapper::processHistoryID_
private

Definition at line 66 of file BranchMapper.h.

Referenced by processHistoryID().