CMS 3D CMS Logo

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

edm::BranchMapper Class Reference

#include <BranchMapper.h>

Inheritance diagram for edm::BranchMapper:
edm::BranchMapperWithReader

List of all members.

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.

edm::BranchMapper::BranchMapper ( bool  delayedRead) [explicit]

Definition at line 17 of file BranchMapper.cc.

edm::BranchMapper::~BranchMapper ( ) [virtual]

Definition at line 24 of file BranchMapper.cc.

{}

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

                                                              {
    readProvenance();
    ProductProvenance ei(bid);
    eiSet::const_iterator it = entryInfoSet_.find(ei);
    if (it == entryInfoSet_.end()) {
      if (nextMapper_) {
        return nextMapper_->branchIDToProvenance(bid);
      } else {
        return boost::shared_ptr<ProductProvenance>();
      }
    }
    return boost::shared_ptr<ProductProvenance>(new ProductProvenance(*it));
  }
void edm::BranchMapper::insert ( ProductProvenance const &  provenanceProduct)

Definition at line 35 of file BranchMapper.cc.

References entryInfoSet_.

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

Definition at line 40 of file BranchMapper.h.

References nextMapper_.

{nextMapper_ = other;}
BranchID edm::BranchMapper::oldProductIDToBranchID ( ProductID const &  oldProductID) const [inline]

Definition at line 44 of file BranchMapper.h.

References oldProductIDToBranchID_().

                                                                         {
      return oldProductIDToBranchID_(oldProductID);
    }
BranchID edm::BranchMapper::oldProductIDToBranchID_ ( ProductID const &  oldProductID) const [private, virtual]

Reimplemented in edm::BranchMapperWithReader.

Definition at line 59 of file BranchMapper.cc.

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

Referenced by oldProductIDToBranchID().

                                                               {
    throw edm::Exception(errors::LogicError)
        << "Internal error:  Illegal call of oldProductIDToBranchID_.\n"
        << "Please report this error to the Framework group\n";
  }
ProcessHistoryID& edm::BranchMapper::processHistoryID ( ) [inline]

Definition at line 50 of file BranchMapper.h.

References processHistoryID_.

ProcessHistoryID const& edm::BranchMapper::processHistoryID ( ) const [inline]

Definition at line 48 of file BranchMapper.h.

References processHistoryID_.

void edm::BranchMapper::readProvenance ( ) const [private]

Definition at line 27 of file BranchMapper.cc.

References delayedRead_, and readProvenance_().

Referenced by branchIDToProvenance().

                                     {
    if (delayedRead_) {
      delayedRead_ = false;
      readProvenance_();
    }
  }
virtual void edm::BranchMapper::readProvenance_ ( ) const [inline, private, virtual]

Reimplemented in edm::BranchMapperWithReader.

Definition at line 56 of file BranchMapper.h.

Referenced by readProvenance().

{}
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_ [mutable, private]

Definition at line 64 of file BranchMapper.h.

Referenced by readProvenance(), and setDelayedRead().

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

Definition at line 66 of file BranchMapper.h.

Referenced by processHistoryID().