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

36  :
37 pBeginIndex_(iBeginIndexItr),
38 pEndIndex_(iEndIndexItr),
39 pBranchCounts_(iBranchCounts),
41 nPathsOn_(0)
42 {
43 }
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 51 of file EarlyDeleteHelper.h.

References nPathsOn_.

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

Definition at line 91 of file EarlyDeleteHelper.cc.

References pEndIndex_.

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

Definition at line 55 of file EarlyDeleteHelper.h.

References pBeginIndex_.

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

Definition at line 56 of file EarlyDeleteHelper.h.

References pEndIndex_.

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

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

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

Definition at line 83 of file EarlyDeleteHelper.cc.

References moduleRan(), and pathsLeftToComplete_.

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

83  {
85  //we can never reach this module now so declare it as run
86  moduleRan(iEvent);
87  }
88 }
unsigned int pathsLeftToComplete_
void moduleRan(EventPrincipal &)
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_.

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

Member Data Documentation

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