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 Attributes
edm::EarlyDeleteHelper Class Reference

#include <EarlyDeleteHelper.h>

Public Member Functions

void addedToPath ()
 
void appendIndex (unsigned int index)
 
unsigned int * begin ()
 
 EarlyDeleteHelper (unsigned int *iBeginIndexItr, unsigned int *iEndIndexItr, std::vector< std::pair< edm::BranchID, unsigned int >> *iBranchCounts)
 
 EarlyDeleteHelper (const EarlyDeleteHelper &)=default
 
unsigned int * end ()
 
void moduleRan (EventPrincipal &)
 
EarlyDeleteHelperoperator= (const EarlyDeleteHelper &)=default
 
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 31 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 33 of file EarlyDeleteHelper.cc.

35  :
36 pBeginIndex_(iBeginIndexItr),
37 pEndIndex_(iEndIndexItr),
38 pBranchCounts_(iBranchCounts),
40 nPathsOn_(0)
41 {
42 }
std::vector< std::pair< edm::BranchID, unsigned int > > * pBranchCounts_
unsigned int pathsLeftToComplete_
unsigned int * pBeginIndex_
edm::EarlyDeleteHelper::EarlyDeleteHelper ( const EarlyDeleteHelper )
default

Member Function Documentation

void edm::EarlyDeleteHelper::addedToPath ( )
inline

Definition at line 50 of file EarlyDeleteHelper.h.

References nPathsOn_.

50 { ++nPathsOn_;}
void EarlyDeleteHelper::appendIndex ( unsigned int  index)

Definition at line 90 of file EarlyDeleteHelper.cc.

References pEndIndex_.

90  {
91  *pEndIndex_=iIndex;
92  ++pEndIndex_;
93 }
unsigned int* edm::EarlyDeleteHelper::begin ( void  )
inline

Definition at line 54 of file EarlyDeleteHelper.h.

References pBeginIndex_.

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

Definition at line 55 of file EarlyDeleteHelper.h.

References pEndIndex_.

Referenced by Types.LuminosityBlockRange::cppID(), and Types.EventRange::cppID().

55 { return pEndIndex_;}
void EarlyDeleteHelper::moduleRan ( EventPrincipal iEvent)

Definition at line 69 of file EarlyDeleteHelper.cc.

References assert(), prof2calltree::count, edm::Principal::deleteProduct(), pathsLeftToComplete_, pBeginIndex_, and pEndIndex_.

Referenced by pathFinished(), and edm::Worker::postDoEvent().

69  {
71  for(auto it = pBeginIndex_; it != pEndIndex_;++it) {
72  auto& count = (*pBranchCounts_)[*it];
73  assert(count.second>0);
74  --(count.second);
75  if(count.second==0) {
76  iEvent.deleteProduct(count.first);
77  }
78  }
79 }
assert(m_qm.get())
unsigned int pathsLeftToComplete_
unsigned int * pBeginIndex_
void deleteProduct(BranchID const &id)
Definition: Principal.cc:330
EarlyDeleteHelper& edm::EarlyDeleteHelper::operator= ( const EarlyDeleteHelper )
default
void EarlyDeleteHelper::pathFinished ( EventPrincipal iEvent)

Definition at line 82 of file EarlyDeleteHelper.cc.

References moduleRan(), and pathsLeftToComplete_.

Referenced by edm::Worker::pathFinished().

82  {
84  //we can never reach this module now so declare it as run
85  moduleRan(iEvent);
86  }
87 }
unsigned int pathsLeftToComplete_
void moduleRan(EventPrincipal &)
void edm::EarlyDeleteHelper::reset ( void  )
inline

Definition at line 47 of file EarlyDeleteHelper.h.

References nPathsOn_, and pathsLeftToComplete_.

void EarlyDeleteHelper::shiftIndexPointers ( unsigned int  iShift)

Definition at line 96 of file EarlyDeleteHelper.cc.

References pBeginIndex_, and pEndIndex_.

96  {
97  pEndIndex_ -=iShift;
98  pBeginIndex_ -=iShift;
99 }
unsigned int * pBeginIndex_

Member Data Documentation

unsigned int edm::EarlyDeleteHelper::nPathsOn_
private

Definition at line 64 of file EarlyDeleteHelper.h.

Referenced by addedToPath(), and reset().

unsigned int edm::EarlyDeleteHelper::pathsLeftToComplete_
private

Definition at line 63 of file EarlyDeleteHelper.h.

Referenced by moduleRan(), pathFinished(), and reset().

unsigned int* edm::EarlyDeleteHelper::pBeginIndex_
private

Definition at line 60 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 62 of file EarlyDeleteHelper.h.

unsigned int* edm::EarlyDeleteHelper::pEndIndex_
private

Definition at line 61 of file EarlyDeleteHelper.h.

Referenced by appendIndex(), end(), moduleRan(), and shiftIndexPointers().