Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
RJittedFilter.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_RJITTEDFILTER
12 #define ROOT_RJITTEDFILTER
13 
14 #include "ROOT/RDF/GraphNode.hxx"
15 #include "ROOT/RDF/RFilterBase.hxx"
17 #include "ROOT/RStringView.hxx"
18 #include "RtypesCore.h"
19 
20 #include <memory>
21 #include <string>
22 #include <vector>
23 
24 class TTreeReader;
25 
26 namespace ROOT {
27 namespace RDF {
28 class RCutFlowReport;
29 }
30 
31 namespace Detail {
32 namespace RDF {
33 
34 namespace RDFGraphDrawing = ROOT::Internal::RDF::GraphDrawing;
35 
36 /// A wrapper around a concrete RFilter, which forwards all calls to it
37 /// RJittedFilter is the type of the node returned by jitted Filter calls: the concrete filter can be created and set
38 /// at a later time, from jitted code.
39 class RJittedFilter final : public RFilterBase {
40  std::unique_ptr<RFilterBase> fConcreteFilter = nullptr;
41 
42 public:
43  RJittedFilter(RLoopManager *lm, std::string_view name);
44  ~RJittedFilter() { fLoopManager->Deregister(this); }
45 
46  void SetFilter(std::unique_ptr<RFilterBase> f);
47 
48  void InitSlot(TTreeReader *r, unsigned int slot) final;
49  bool CheckFilters(unsigned int slot, Long64_t entry) final;
50  void Report(ROOT::RDF::RCutFlowReport &) const final;
51  void PartialReport(ROOT::RDF::RCutFlowReport &) const final;
52  void FillReport(ROOT::RDF::RCutFlowReport &) const final;
53  void IncrChildrenCount() final;
54  void StopProcessing() final;
55  void ResetChildrenCount() final;
56  void TriggerChildrenCount() final;
57  void ResetReportCount() final;
58  void ClearValueReaders(unsigned int slot) final;
59  void InitNode() final;
60  void AddFilterName(std::vector<std::string> &filters) final;
61  void ClearTask(unsigned int slot) final;
62  std::shared_ptr<RDFGraphDrawing::GraphNode> GetGraph();
63 };
64 
65 } // ns RDF
66 } // ns Detail
67 } // ns ROOT
68 
69 #endif // ROOT_RJITTEDFILTER