CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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) : branch(id), count(count) {}
36 
37  BranchToCount(BranchToCount const& iOther) : branch(iOther.branch), count(iOther.count.load()) {}
38  };
39 
41  public:
42  EarlyDeleteHelper(unsigned int* iBeginIndexItr,
43  unsigned int* iEndIndexItr,
44  std::vector<BranchToCount>* iBranchCounts);
47  //virtual ~EarlyDeleteHelper();
48 
49  // ---------- const member functions ---------------------
50 
51  // ---------- static member functions --------------------
52 
53  // ---------- member functions ---------------------------
55  void moduleRan(EventPrincipal const&);
56  void pathFinished(EventPrincipal const&);
57  void addedToPath() { ++nPathsOn_; }
58  void appendIndex(unsigned int index);
59  void shiftIndexPointers(unsigned int iShift);
60 
61  unsigned int* begin() { return pBeginIndex_; }
62  unsigned int* end() { return pEndIndex_; }
63 
64  private:
65  // ---------- member data --------------------------------
66  unsigned int* pBeginIndex_;
67  unsigned int* pEndIndex_;
68  std::vector<BranchToCount>* pBranchCounts_;
69  std::atomic<unsigned int> pathsLeftToComplete_;
70  unsigned int nPathsOn_;
71  };
72 } // namespace edm
73 
74 #endif
void appendIndex(unsigned int index)
std::atomic< unsigned int > pathsLeftToComplete_
EarlyDeleteHelper(unsigned int *iBeginIndexItr, unsigned int *iEndIndexItr, std::vector< BranchToCount > *iBranchCounts)
BranchToCount(BranchToCount const &iOther)
def load
Definition: svgfig.py:547
unsigned int * pBeginIndex_
edm::BranchID const branch
void moduleRan(EventPrincipal const &)
std::atomic< unsigned int > count
std::vector< BranchToCount > * pBranchCounts_
void pathFinished(EventPrincipal const &)
void shiftIndexPointers(unsigned int iShift)
EarlyDeleteHelper & operator=(const EarlyDeleteHelper &)=delete
BranchToCount(edm::BranchID id, unsigned int count)
unsigned int * begin()