Logo ROOT   6.21/01
Reference Guide
RJittedCustomColumn.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_RJITTEDCUSTOMCOLUMN
12 #define ROOT_RJITTEDCUSTOMCOLUMN
13 
15 #include "ROOT/RStringView.hxx"
16 #include "RtypesCore.h"
17 
18 #include <memory>
19 #include <type_traits>
20 
21 class TTreeReader;
22 
23 namespace ROOT {
24 namespace Detail {
25 namespace RDF {
26 
27 class RLoopManager;
28 
29 /// A wrapper around a concrete RCustomColumn, which forwards all calls to it
30 /// RJittedCustomColumn is a placeholder that is put in the collection of custom columns in place of a RCustomColumn
31 /// that will be just-in-time compiled. Jitted code will assign the concrete RCustomColumn to this RJittedCustomColumn
32 /// before the event-loop starts.
34  std::unique_ptr<RCustomColumnBase> fConcreteCustomColumn = nullptr;
35 
36 public:
37  RJittedCustomColumn(RLoopManager *lm, std::string_view name, unsigned int nSlots)
38  : RCustomColumnBase(lm, name, nSlots, /*isDSColumn=*/false, RDFInternal::RBookedCustomColumns())
39  {
40  }
41 
42  void SetCustomColumn(std::unique_ptr<RCustomColumnBase> c) { fConcreteCustomColumn = std::move(c); }
43 
44  void InitSlot(TTreeReader *r, unsigned int slot) final;
45  void *GetValuePtr(unsigned int slot) final;
46  const std::type_info &GetTypeId() const final;
47  void Update(unsigned int slot, Long64_t entry) final;
48  void ClearValueReaders(unsigned int slot) final;
49  void InitNode() final;
50 };
51 
52 } // ns RDF
53 } // ns Detail
54 } // ns ROOT
55 
56 #endif // ROOT_RJITTEDCUSTOMCOLUMN
RJittedCustomColumn(RLoopManager *lm, std::string_view name, unsigned int nSlots)
The head node of a RDF computation graph.
long long Long64_t
Definition: RtypesCore.h:69
A simple, robust and fast interface to read values from ROOT columnar datasets such as TTree...
Definition: TTreeReader.h:43
Returns the available number of logical cores.
Definition: StringConv.hxx:21
const std::type_info & GetTypeId() const final
void * GetValuePtr(unsigned int slot) final
void SetCustomColumn(std::unique_ptr< RCustomColumnBase > c)
std::unique_ptr< RCustomColumnBase > fConcreteCustomColumn
void Update(unsigned int slot, Long64_t entry) final
void InitSlot(TTreeReader *r, unsigned int slot) final
ROOT::R::TRInterface & r
Definition: Object.C:4
void ClearValueReaders(unsigned int slot) final
A wrapper around a concrete RCustomColumn, which forwards all calls to it RJittedCustomColumn is a pl...
#define c(i)
Definition: RSha256.hxx:101
char name[80]
Definition: TGX11.cxx:109