File indexing completed on 2025-01-18 10:10:35
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 virtual ~RNodeBase() {}
0056 virtual bool CheckFilters(unsigned int, Long64_t) = 0;
0057 virtual void Report(ROOT::RDF::RCutFlowReport &) const = 0;
0058 virtual void PartialReport(ROOT::RDF::RCutFlowReport &) const = 0;
0059 virtual void IncrChildrenCount() = 0;
0060 virtual void StopProcessing() = 0;
0061 virtual void AddFilterName(std::vector<std::string> &filters) = 0;
0062
0063 virtual std::shared_ptr<ROOT::Internal::RDF::GraphDrawing::GraphNode>
0064 GetGraph(std::unordered_map<void *, std::shared_ptr<ROOT::Internal::RDF::GraphDrawing::GraphNode>> &visitedMap) = 0;
0065
0066 virtual void ResetChildrenCount()
0067 {
0068 fNChildren = 0;
0069 fNStopsReceived = 0;
0070 }
0071
0072 virtual RLoopManager *GetLoopManagerUnchecked() { return fLoopManager; }
0073
0074 const std::vector<std::string> &GetVariations() const { return fVariations; }
0075
0076
0077 virtual std::shared_ptr<RNodeBase> GetVariedFilter(const std::string & )
0078 {
0079 R__ASSERT(false &&
0080 "GetVariedFilter was called on a node type that does not implement it. This should never happen.");
0081 return nullptr;
0082 }
0083 };
0084 }
0085 }
0086 }
0087
0088 #endif