Logo ROOT  
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
27/// A wrapper around a concrete RCustomColumn, which forwards all calls to it
28/// RJittedCustomColumn is a placeholder that is put in the collection of custom columns in place of a RCustomColumn
29/// that will be just-in-time compiled. Jitted code will assign the concrete RCustomColumn to this RJittedCustomColumn
30/// before the event-loop starts.
32 std::unique_ptr<RCustomColumnBase> fConcreteCustomColumn = nullptr;
33
34public:
36 : RCustomColumnBase(name, type, nSlots, /*isDSColumn=*/false, RDFInternal::RBookedCustomColumns())
37 {
38 }
39
40 void SetCustomColumn(std::unique_ptr<RCustomColumnBase> c) { fConcreteCustomColumn = std::move(c); }
41
42 void InitSlot(TTreeReader *r, unsigned int slot) final;
43 void *GetValuePtr(unsigned int slot) final;
44 const std::type_info &GetTypeId() const final;
45 void Update(unsigned int slot, Long64_t entry) final;
46 void ClearValueReaders(unsigned int slot) final;
47};
48
49} // ns RDF
50} // ns Detail
51} // ns ROOT
52
53#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:71
char name[80]
Definition: TGX11.cxx:109
int type
Definition: TGX11.cxx:120
A wrapper around a concrete RCustomColumn, which forwards all calls to it RJittedCustomColumn is a pl...
void ClearValueReaders(unsigned int slot) final
RJittedCustomColumn(std::string_view name, std::string_view type, unsigned int nSlots)
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
const std::type_info & GetTypeId() const final
A simple, robust and fast interface to read values from ROOT columnar datasets such as TTree,...
Definition: TTreeReader.h:43
basic_string_view< char > string_view
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition: StringConv.hxx:21