CMS 3D CMS Logo

Public Member Functions | Private Attributes

edm::EarlyDeleteHelper Class Reference

#include <EarlyDeleteHelper.h>

List of all members.

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 &)
EarlyDeleteHelperoperator= (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_

Detailed Description

Definition at line 32 of file EarlyDeleteHelper.h.


Constructor & Destructor Documentation

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 )

Member Function Documentation

void edm::EarlyDeleteHelper::addedToPath ( ) [inline]

Definition at line 51 of file EarlyDeleteHelper.h.

References nPathsOn_.

{ ++nPathsOn_;}
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]

Definition at line 55 of file EarlyDeleteHelper.h.

References pBeginIndex_.

{ return pBeginIndex_;}
unsigned int* edm::EarlyDeleteHelper::end ( void  ) [inline]

Definition at line 56 of file EarlyDeleteHelper.h.

References pEndIndex_.

{ return pEndIndex_;}
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;
}

Member Data Documentation

unsigned int edm::EarlyDeleteHelper::nPathsOn_ [private]

Definition at line 65 of file EarlyDeleteHelper.h.

Referenced by addedToPath(), and reset().

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