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
26 
27 // forward declarations
28 namespace edm {
29  class BranchID;
30  class EventPrincipal;
31 
32  struct BranchToCount {
34  std::atomic<unsigned int> count;
35 
36  BranchToCount(edm::BranchID id, unsigned int count):
37  branch(id),
38  count(count) {}
39 
40  BranchToCount(BranchToCount const& iOther):
41  branch(iOther.branch),
42  count(iOther.count.load()) {}
43  };
44 
46  {
47 
48  public:
49  EarlyDeleteHelper(unsigned int* iBeginIndexItr,
50  unsigned int* iEndIndexItr,
51  std::vector<BranchToCount>* iBranchCounts);
53  EarlyDeleteHelper& operator=(const EarlyDeleteHelper&) = default;
54  //virtual ~EarlyDeleteHelper();
55 
56  // ---------- const member functions ---------------------
57 
58  // ---------- static member functions --------------------
59 
60  // ---------- member functions ---------------------------
61  void reset() {pathsLeftToComplete_ = nPathsOn_;}
62  void moduleRan(EventPrincipal const&);
63  void pathFinished(EventPrincipal const&);
64  void addedToPath() { ++nPathsOn_;}
65  void appendIndex(unsigned int index);
66  void shiftIndexPointers(unsigned int iShift);
67 
68  unsigned int* begin() { return pBeginIndex_;}
69  unsigned int* end() { return pEndIndex_;}
70 
71  private:
72 
73  // ---------- member data --------------------------------
74  unsigned int* pBeginIndex_;
75  unsigned int* pEndIndex_;
76  std::vector<BranchToCount>* pBranchCounts_;
77  std::atomic<unsigned int> pathsLeftToComplete_;
78  unsigned int nPathsOn_;
79 
80  };
81 }
82 
83 
84 #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()