CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EarlyDeleteHelper.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Framework
4 // Class : EarlyDeleteHelper
5 //
6 // Implementation:
7 // [Notes on implementation]
8 //
9 // Original Author: Chris Jones
10 // Created: Mon Feb 6 16:17:10 CST 2012
11 //
12 
13 // system include files
14 
15 // user include files
18 
20 
21 using namespace edm;
22 //
23 // constants, enums and typedefs
24 //
25 
26 //
27 // static data member definitions
28 //
29 
30 //
31 // constructors and destructor
32 //
33 EarlyDeleteHelper::EarlyDeleteHelper(unsigned int* iBeginIndexItr,
34  unsigned int* iEndIndexItr,
35  std::vector<std::pair<edm::BranchID,unsigned int>>* iBranchCounts):
36 pBeginIndex_(iBeginIndexItr),
37 pEndIndex_(iEndIndexItr),
38 pBranchCounts_(iBranchCounts),
39 pathsLeftToComplete_(0),
40 nPathsOn_(0)
41 {
42 }
43 
44 // EarlyDeleteHelper::EarlyDeleteHelper(const EarlyDeleteHelper& rhs)
45 // {
46 // // do actual copying here;
47 // }
48 
49 //EarlyDeleteHelper::~EarlyDeleteHelper()
50 //{
51 //}
52 
53 //
54 // assignment operators
55 //
56 // const EarlyDeleteHelper& EarlyDeleteHelper::operator=(const EarlyDeleteHelper& rhs)
57 // {
58 // //An exception safe implementation is
59 // EarlyDeleteHelper temp(rhs);
60 // swap(rhs);
61 //
62 // return *this;
63 // }
64 
65 //
66 // member functions
67 //
68 void
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 }
80 
81 void
84  //we can never reach this module now so declare it as run
85  moduleRan(iEvent);
86  }
87 }
88 
89 void
90 EarlyDeleteHelper::appendIndex(unsigned int iIndex) {
91  *pEndIndex_=iIndex;
92  ++pEndIndex_;
93 }
94 
95 void
97  pEndIndex_ -=iShift;
98  pBeginIndex_ -=iShift;
99 }
100 
101 //
102 // const member functions
103 //
104 
105 //
106 // static member functions
107 //
void appendIndex(unsigned int index)
unsigned int pathsLeftToComplete_
int iEvent
Definition: GenABIO.cc:230
EarlyDeleteHelper(unsigned int *iBeginIndexItr, unsigned int *iEndIndexItr, std::vector< std::pair< edm::BranchID, unsigned int >> *iBranchCounts)
unsigned int * pBeginIndex_
void moduleRan(EventPrincipal &)
void shiftIndexPointers(unsigned int iShift)
void pathFinished(EventPrincipal &)
void deleteProduct(BranchID const &id)
Definition: Principal.cc:315