File indexing completed on 2025-09-17 09:14:19
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef ROOT_RDFNODEBASE
0012 #define ROOT_RDFNODEBASE
0013
0014 #include "RtypesCore.h"
0015 #include "TError.h" // R__ASSERT
0016
0017 #include <memory>
0018 #include <string>
0019 #include <vector>
0020 #include <unordered_map>
0021
0022 namespace ROOT {
0023 namespace RDF {
0024 class RCutFlowReport;
0025 }
0026
0027 namespace Internal {
0028 namespace RDF {
0029 namespace GraphDrawing {
0030 class GraphNode;
0031 }
0032 }
0033 }
0034
0035 namespace Detail {
0036 namespace RDF {
0037
0038 class RLoopManager;
0039
0040
0041
0042
0043 class RNodeBase {
0044 protected:
0045 RLoopManager *fLoopManager;
0046 unsigned int fNChildren{0};
0047 unsigned int fNStopsReceived{0};
0048 std::vector<std::string> fVariations;
0049
0050 public:
0051 RNodeBase(const std::vector<std::string> &variations = {}, RLoopManager *lm = nullptr)
0052 : fLoopManager(lm), fVariations(variations)
0053 {
0054 }
0055
0056
0057 RNodeBase(const RNodeBase &) = delete;
0058 RNodeBase &operator=(const RNodeBase &) = delete;
0059 RNodeBase(RNodeBase &&) = delete;
0060 RNodeBase &operator=(RNodeBase &&) = delete;
0061 virtual ~RNodeBase() = default;
0062
0063 virtual bool CheckFilters(unsigned int, Long64_t) = 0;
0064 virtual void Report(ROOT::RDF::RCutFlowReport &) const = 0;
0065 virtual void PartialReport(ROOT::RDF::RCutFlowReport &) const = 0;
0066 virtual void IncrChildrenCount() = 0;
0067 virtual void StopProcessing() = 0;
0068 virtual void AddFilterName(std::vector<std::string> &filters) = 0;
0069
0070 virtual std::shared_ptr<ROOT::Internal::RDF::GraphDrawing::GraphNode>
0071 GetGraph(std::unordered_map<void *, std::shared_ptr<ROOT::Internal::RDF::GraphDrawing::GraphNode>> &visitedMap) = 0;
0072
0073 virtual void ResetChildrenCount()
0074 {
0075 fNChildren = 0;
0076 fNStopsReceived = 0;
0077 }
0078
0079 virtual RLoopManager *GetLoopManagerUnchecked() { return fLoopManager; }
0080
0081 const std::vector<std::string> &GetVariations() const { return fVariations; }
0082
0083
0084 virtual std::shared_ptr<RNodeBase> GetVariedFilter(const std::string & )
0085 {
0086 R__ASSERT(false &&
0087 "GetVariedFilter was called on a node type that does not implement it. This should never happen.");
0088 return nullptr;
0089 }
0090 };
0091 }
0092 }
0093 }
0094
0095 #endif