Logo ROOT   6.18/05
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
21class TTreeReader;
22
23namespace ROOT {
24namespace Detail {
25namespace RDF {
26
27class 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
36public:
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
ROOT::R::TRInterface & r
Definition: Object.C:4
#define c(i)
Definition: RSha256.hxx:101
long long Long64_t
Definition: RtypesCore.h:69
char name[80]
Definition: TGX11.cxx:109
A wrapper around a concrete RCustomColumn, which forwards all calls to it RJittedCustomColumn is a pl...
void ClearValueReaders(unsigned int slot) final
void * GetValuePtr(unsigned int slot) final
void SetCustomColumn(std::unique_ptr< RCustomColumnBase > c)
RJittedCustomColumn(RLoopManager *lm, std::string_view name, unsigned int nSlots)
std::unique_ptr< RCustomColumnBase > fConcreteCustomColumn
void Update(unsigned int slot, Long64_t entry) final
void InitSlot(TTreeReader *r, unsigned int slot) final
const std::type_info & GetTypeId() const final
The head node of a RDF computation graph.
A simple, robust and fast interface to read values from ROOT columnar datasets such as TTree,...
Definition: TTreeReader.h:44
basic_string_view< char > string_view
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21