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 // $Id: EarlyDeleteHelper.cc,v 1.1 2012/02/09 22:12:56 chrjones Exp $
12 //
13 
14 // system include files
15 
16 // user include files
19 
21 
22 using namespace edm;
23 //
24 // constants, enums and typedefs
25 //
26 
27 //
28 // static data member definitions
29 //
30 
31 //
32 // constructors and destructor
33 //
34 EarlyDeleteHelper::EarlyDeleteHelper(unsigned int* iBeginIndexItr,
35  unsigned int* iEndIndexItr,
36  std::vector<std::pair<edm::BranchID,unsigned int>>* iBranchCounts):
37 pBeginIndex_(iBeginIndexItr),
38 pEndIndex_(iEndIndexItr),
39 pBranchCounts_(iBranchCounts),
40 pathsLeftToComplete_(0),
41 nPathsOn_(0)
42 {
43 }
44 
45 // EarlyDeleteHelper::EarlyDeleteHelper(const EarlyDeleteHelper& rhs)
46 // {
47 // // do actual copying here;
48 // }
49 
50 //EarlyDeleteHelper::~EarlyDeleteHelper()
51 //{
52 //}
53 
54 //
55 // assignment operators
56 //
57 // const EarlyDeleteHelper& EarlyDeleteHelper::operator=(const EarlyDeleteHelper& rhs)
58 // {
59 // //An exception safe implementation is
60 // EarlyDeleteHelper temp(rhs);
61 // swap(rhs);
62 //
63 // return *this;
64 // }
65 
66 //
67 // member functions
68 //
69 void
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 }
81 
82 void
85  //we can never reach this module now so declare it as run
86  moduleRan(iEvent);
87  }
88 }
89 
90 void
91 EarlyDeleteHelper::appendIndex(unsigned int iIndex) {
92  *pEndIndex_=iIndex;
93  ++pEndIndex_;
94 }
95 
96 void
98  pEndIndex_ -=iShift;
99  pBeginIndex_ -=iShift;
100 }
101 
102 //
103 // const member functions
104 //
105 
106 //
107 // static member functions
108 //
void appendIndex(unsigned int index)
unsigned int pathsLeftToComplete_
int iEvent
Definition: GenABIO.cc:243
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:217