Logo ROOT  
Reference Guide
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
15#include "RtypesCore.h"
16
17#include <unordered_map>
18
19namespace ROOT {
20namespace Internal {
21namespace RDF {
22namespace GraphDrawing {
23class GraphNode;
24}
25} // namespace RDF
26} // namespace Internal
27
28namespace Detail {
29namespace RDF {
31
32class RLoopManager;
33
34class RRangeBase : public RNodeBase {
35protected:
36 unsigned int fStart;
37 unsigned int fStop;
38 unsigned int fStride;
40 bool fLastResult{true};
42 bool fHasStopped{false}; ///< True if the end of the range has been reached
43 const unsigned int fNSlots; ///< Number of thread slots used by this node, inherited from parent node.
44 std::unordered_map<std::string, std::shared_ptr<RRangeBase>> fVariedRanges;
45
46 void ResetCounters();
47
48public:
49 RRangeBase(RLoopManager *implPtr, unsigned int start, unsigned int stop, unsigned int stride,
50 const unsigned int nSlots, const std::vector<std::string> &prevVariations);
51
52 RRangeBase &operator=(const RRangeBase &) = delete;
53 virtual ~RRangeBase();
54
55 void InitNode() { ResetCounters(); }
56 virtual std::shared_ptr<RDFGraphDrawing::GraphNode>
57 GetGraph(std::unordered_map<void *, std::shared_ptr<RDFGraphDrawing::GraphNode>> &visitedMap) = 0;
58};
59
60} // ns RDF
61} // ns Detail
62} // namespace ROOT
63
64#endif // ROOT_RRANGEBASE
long long Long64_t
Definition: RtypesCore.h:80
unsigned long long ULong64_t
Definition: RtypesCore.h:81
The head node of a RDF computation graph.
Base class for non-leaf nodes of the computational graph.
Definition: RNodeBase.hxx:43
RRangeBase & operator=(const RRangeBase &)=delete
RRangeBase(RLoopManager *implPtr, unsigned int start, unsigned int stop, unsigned int stride, const unsigned int nSlots, const std::vector< std::string > &prevVariations)
Definition: RRangeBase.cxx:16
virtual std::shared_ptr< RDFGraphDrawing::GraphNode > GetGraph(std::unordered_map< void *, std::shared_ptr< RDFGraphDrawing::GraphNode > > &visitedMap)=0
std::unordered_map< std::string, std::shared_ptr< RRangeBase > > fVariedRanges
Definition: RRangeBase.hxx:44
const unsigned int fNSlots
Number of thread slots used by this node, inherited from parent node.
Definition: RRangeBase.hxx:43
bool fHasStopped
True if the end of the range has been reached.
Definition: RRangeBase.hxx:42
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.