#include <EarlyDeleteHelper.h>
Public Member Functions | |
void | addedToPath () |
void | appendIndex (unsigned int index) |
unsigned int * | begin () |
EarlyDeleteHelper (const EarlyDeleteHelper &) | |
EarlyDeleteHelper (unsigned int *iBeginIndexItr, unsigned int *iEndIndexItr, std::vector< std::pair< edm::BranchID, unsigned int >> *iBranchCounts) | |
unsigned int * | end () |
void | moduleRan (EventPrincipal &) |
EarlyDeleteHelper & | operator= (const EarlyDeleteHelper &) |
void | pathFinished (EventPrincipal &) |
void | reset () |
void | shiftIndexPointers (unsigned int iShift) |
Private Attributes | |
unsigned int | nPathsOn_ |
unsigned int | pathsLeftToComplete_ |
unsigned int * | pBeginIndex_ |
std::vector< std::pair < edm::BranchID, unsigned int > > * | pBranchCounts_ |
unsigned int * | pEndIndex_ |
Definition at line 32 of file EarlyDeleteHelper.h.
EarlyDeleteHelper::EarlyDeleteHelper | ( | unsigned int * | iBeginIndexItr, |
unsigned int * | iEndIndexItr, | ||
std::vector< std::pair< edm::BranchID, unsigned int >> * | iBranchCounts | ||
) |
Definition at line 34 of file EarlyDeleteHelper.cc.
: pBeginIndex_(iBeginIndexItr), pEndIndex_(iEndIndexItr), pBranchCounts_(iBranchCounts), pathsLeftToComplete_(0), nPathsOn_(0) { }
edm::EarlyDeleteHelper::EarlyDeleteHelper | ( | const EarlyDeleteHelper & | ) |
void edm::EarlyDeleteHelper::addedToPath | ( | ) | [inline] |
void EarlyDeleteHelper::appendIndex | ( | unsigned int | index | ) |
Definition at line 91 of file EarlyDeleteHelper.cc.
References pEndIndex_.
{ *pEndIndex_=iIndex; ++pEndIndex_; }
unsigned int* edm::EarlyDeleteHelper::begin | ( | void | ) | [inline] |
unsigned int* edm::EarlyDeleteHelper::end | ( | void | ) | [inline] |
void EarlyDeleteHelper::moduleRan | ( | EventPrincipal & | iEvent | ) |
Definition at line 70 of file EarlyDeleteHelper.cc.
References prof2calltree::count, edm::Principal::deleteProduct(), pathsLeftToComplete_, pBeginIndex_, and pEndIndex_.
Referenced by pathFinished(), and edm::Worker::postDoEvent().
{ pathsLeftToComplete_=0; for(auto it = pBeginIndex_; it != pEndIndex_;++it) { auto& count = (*pBranchCounts_)[*it]; assert(count.second>0); --(count.second); if(count.second==0) { iEvent.deleteProduct(count.first); } } }
EarlyDeleteHelper& edm::EarlyDeleteHelper::operator= | ( | const EarlyDeleteHelper & | ) |
void EarlyDeleteHelper::pathFinished | ( | EventPrincipal & | iEvent | ) |
Definition at line 83 of file EarlyDeleteHelper.cc.
References moduleRan(), and pathsLeftToComplete_.
Referenced by edm::Worker::pathFinished().
{ if(pathsLeftToComplete_>0 && --pathsLeftToComplete_ == 0) { //we can never reach this module now so declare it as run moduleRan(iEvent); } }
void edm::EarlyDeleteHelper::reset | ( | void | ) | [inline] |
Definition at line 48 of file EarlyDeleteHelper.h.
References nPathsOn_, and pathsLeftToComplete_.
void EarlyDeleteHelper::shiftIndexPointers | ( | unsigned int | iShift | ) |
Definition at line 97 of file EarlyDeleteHelper.cc.
References pBeginIndex_, and pEndIndex_.
{ pEndIndex_ -=iShift; pBeginIndex_ -=iShift; }
unsigned int edm::EarlyDeleteHelper::nPathsOn_ [private] |
Definition at line 65 of file EarlyDeleteHelper.h.
Referenced by addedToPath(), and reset().
unsigned int edm::EarlyDeleteHelper::pathsLeftToComplete_ [private] |
Definition at line 64 of file EarlyDeleteHelper.h.
Referenced by moduleRan(), pathFinished(), and reset().
unsigned int* edm::EarlyDeleteHelper::pBeginIndex_ [private] |
Definition at line 61 of file EarlyDeleteHelper.h.
Referenced by begin(), moduleRan(), and shiftIndexPointers().
std::vector<std::pair<edm::BranchID,unsigned int> >* edm::EarlyDeleteHelper::pBranchCounts_ [private] |
Definition at line 63 of file EarlyDeleteHelper.h.
unsigned int* edm::EarlyDeleteHelper::pEndIndex_ [private] |
Definition at line 62 of file EarlyDeleteHelper.h.
Referenced by appendIndex(), end(), moduleRan(), and shiftIndexPointers().