CMS 3D CMS Logo

EarlyDeleteHelper.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_EarlyDeleteHelper_h
2 #define FWCore_Framework_EarlyDeleteHelper_h
3 // -*- C++ -*-
4 //
5 // Package: Framework
6 // Class : EarlyDeleteHelper
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Mon Feb 6 16:17:08 CST 2012
19 //
20 
21 // system include files
22 #include <vector>
23 #include <atomic>
24 
25 // user include files
27 // forward declarations
28 namespace edm {
29  class EventPrincipal;
30 
31  struct BranchToCount {
33  std::atomic<unsigned int> count;
34 
35  BranchToCount(edm::BranchID id, unsigned int count):
36  branch(id),
37  count(count) {}
38 
39  BranchToCount(BranchToCount const& iOther):
40  branch(iOther.branch),
41  count(iOther.count.load()) {}
42  };
43 
45  {
46 
47  public:
48  EarlyDeleteHelper(unsigned int* iBeginIndexItr,
49  unsigned int* iEndIndexItr,
50  std::vector<BranchToCount>* iBranchCounts);
52  EarlyDeleteHelper& operator=(const EarlyDeleteHelper&) = default;
53  //virtual ~EarlyDeleteHelper();
54 
55  // ---------- const member functions ---------------------
56 
57  // ---------- static member functions --------------------
58 
59  // ---------- member functions ---------------------------
60  void reset() {pathsLeftToComplete_ = nPathsOn_;}
61  void moduleRan(EventPrincipal const&);
62  void pathFinished(EventPrincipal const&);
63  void addedToPath() { ++nPathsOn_;}
64  void appendIndex(unsigned int index);
65  void shiftIndexPointers(unsigned int iShift);
66 
67  unsigned int* begin() { return pBeginIndex_;}
68  unsigned int* end() { return pEndIndex_;}
69 
70  private:
71 
72  // ---------- member data --------------------------------
73  unsigned int* pBeginIndex_;
74  unsigned int* pEndIndex_;
75  std::vector<BranchToCount>* pBranchCounts_;
76  std::atomic<unsigned int> pathsLeftToComplete_;
77  unsigned int nPathsOn_;
78 
79  };
80 }
81 
82 
83 #endif
std::atomic< unsigned int > pathsLeftToComplete_
BranchToCount(BranchToCount const &iOther)
unsigned int * pBeginIndex_
edm::BranchID const branch
std::atomic< unsigned int > count
std::vector< BranchToCount > * pBranchCounts_
def load(fileName)
Definition: svgfig.py:546
HLT enums.
BranchToCount(edm::BranchID id, unsigned int count)
unsigned int * begin()