Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
RRangeBase.hxx
Go to the documentation of this file.
1 // Author: Enrico Guiraud, Danilo Piparo CERN 09/2018
2 
3 /*************************************************************************
4  * Copyright (C) 1995-2018, Rene Brun and Fons Rademakers. *
5  * All rights reserved. *
6  * *
7  * For the licensing terms see $ROOTSYS/LICENSE. *
8  * For the list of contributors see $ROOTSYS/README/CREDITS. *
9  *************************************************************************/
10 
11 #ifndef ROOT_RRANGEBASE
12 #define ROOT_RRANGEBASE
13 
14 #include "ROOT/RDF/RNodeBase.hxx"
15 #include "RtypesCore.h"
16 
17 namespace ROOT {
18 
19 // fwd decl
20 namespace Internal {
21 namespace RDF {
22 class GraphNode;
23 } // ns RDF
24 } // ns Internal
25 
26 namespace Detail {
27 namespace RDF {
28 namespace RDFGraphDrawing = ROOT::Internal::RDF::GraphDrawing;
29 
30 class RLoopManager;
31 
32 class RRangeBase : public RNodeBase {
33 protected:
34  unsigned int fStart;
35  unsigned int fStop;
36  unsigned int fStride;
37  Long64_t fLastCheckedEntry{-1};
38  bool fLastResult{true};
39  ULong64_t fNProcessedEntries{0};
40  bool fHasStopped{false}; ///< True if the end of the range has been reached
41  const unsigned int fNSlots; ///< Number of thread slots used by this node, inherited from parent node.
42 
43  void ResetCounters();
44 
45 public:
46  RRangeBase(RLoopManager *implPtr, unsigned int start, unsigned int stop, unsigned int stride,
47  const unsigned int nSlots);
48 
49  RRangeBase &operator=(const RRangeBase &) = delete;
50  virtual ~RRangeBase();
51 
52  void InitNode() { ResetCounters(); }
53  virtual std::shared_ptr<RDFGraphDrawing::GraphNode> GetGraph() = 0;
54 };
55 
56 } // ns RDF
57 } // ns Detail
58 } // ns ROOT
59 
60 #endif // ROOT_RRANGEBASE