Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RJittedDefine.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 RDefine, which forwards all calls to it
28/// RJittedDefine is a placeholder that is put in the collection of custom columns in place of a RDefine
29/// that will be just-in-time compiled. Jitted code will assign the concrete RDefine to this RJittedDefine
30/// before the event-loop starts.
31class RJittedDefine : public RDefineBase {
32 std::unique_ptr<RDefineBase> fConcreteDefine = nullptr;
33
34public:
35 RJittedDefine(std::string_view name, std::string_view type, unsigned int nSlots,
36 const std::map<std::string, std::vector<void *>> &DSValuePtrs)
37 : RDefineBase(name, type, nSlots, RDFInternal::RBookedDefines(), DSValuePtrs, nullptr)
38 {
39 }
40
41 void SetDefine(std::unique_ptr<RDefineBase> c) { fConcreteDefine = std::move(c); }
42
43 void InitSlot(TTreeReader *r, unsigned int slot) final;
44 void *GetValuePtr(unsigned int slot) final;
45 const std::type_info &GetTypeId() const final;
46 void Update(unsigned int slot, Long64_t entry) final;
47 void FinaliseSlot(unsigned int slot) final;
48};
49
50} // ns RDF
51} // ns Detail
52} // ns ROOT
53
54#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:73
char name[80]
Definition TGX11.cxx:110
int type
Definition TGX11.cxx:121
A wrapper around a concrete RDefine, which forwards all calls to it RJittedDefine is a placeholder th...
void InitSlot(TTreeReader *r, unsigned int slot) final
void FinaliseSlot(unsigned int slot) final
Clean-up operations to be performed at the end of a task.
std::unique_ptr< RDefineBase > fConcreteDefine
RJittedDefine(std::string_view name, std::string_view type, unsigned int nSlots, const std::map< std::string, std::vector< void * > > &DSValuePtrs)
void SetDefine(std::unique_ptr< RDefineBase > c)
const std::type_info & GetTypeId() const final
void * GetValuePtr(unsigned int slot) final
Return the (type-erased) address of the Define'd value for the given processing slot.
A simple, robust and fast interface to read values from ROOT columnar datasets such as TTree,...
Definition TTreeReader.h:44
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...