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

List of all members.

Public Member Functions

ProductProvenance const * 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
ProcessHistoryIDprocessHistoryID ()
ProcessHistoryID const & processHistoryID () const
void reset ()
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
virtual void reset_ ()

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 54 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

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

Definition at line 51 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 0;
      }
    }
    return &*it;
  }
void edm::BranchMapper::insert ( ProductProvenance const &  provenanceProduct)

Definition at line 42 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, and edm::ReducedProvenanceBranchMapperWithReader.

Definition at line 66 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, and edm::ReducedProvenanceBranchMapperWithReader.

Definition at line 57 of file BranchMapper.h.

Referenced by readProvenance().

{}
void edm::BranchMapper::reset ( void  )

Definition at line 35 of file BranchMapper.cc.

References entryInfoSet_, processHistoryID_, and reset_().

virtual void edm::BranchMapper::reset_ ( ) [inline, private, virtual]

Reimplemented in edm::BranchMapperWithReader, and edm::ReducedProvenanceBranchMapperWithReader.

Definition at line 58 of file BranchMapper.h.

Referenced by reset().

{}
void edm::BranchMapper::setDelayedRead ( bool  value) [inline]
void edm::BranchMapper::write ( std::ostream &  os) const

Referenced by edm::operator<<().


Member Data Documentation

bool edm::BranchMapper::delayedRead_ [mutable, private]

Definition at line 66 of file BranchMapper.h.

Referenced by readProvenance(), and setDelayedRead().

Definition at line 62 of file BranchMapper.h.

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

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

Definition at line 64 of file BranchMapper.h.

Referenced by branchIDToProvenance(), and mergeMappers().

Definition at line 68 of file BranchMapper.h.

Referenced by processHistoryID(), and reset().