Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RDefineReader.hxx
Go to the documentation of this file.
1// Author: Enrico Guiraud CERN 09/2020
2
3/*************************************************************************
4 * Copyright (C) 1995-2020, 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_RDF_RDEFINEREADER
12#define ROOT_RDF_RDEFINEREADER
13
14#include "RColumnReaderBase.hxx"
15#include "RDefineBase.hxx"
16#include <Rtypes.h> // Long64_t, R__CLING_PTRCHECK
17
18#include <limits>
19#include <type_traits>
20
21namespace ROOT {
22namespace Internal {
23namespace RDF {
24
26
27void CheckDefineType(RDFDetail::RDefineBase &define, const std::type_info &tid);
28
29/// Column reader for defined (aka custom) columns.
30class R__CLING_PTRCHECK(off) RDefineReader final : public ROOT::Detail::RDF::RColumnReaderBase {
31 /// Non-owning reference to the node responsible for the custom column. Needed when querying custom values.
33
34 /// Non-owning ptr to the value of a custom column.
35 void *fCustomValuePtr = nullptr;
36
37 /// The slot this value belongs to.
38 unsigned int fSlot = std::numeric_limits<unsigned int>::max();
39
40 void *GetImpl(Long64_t entry) final
41 {
42 fDefine.Update(fSlot, entry);
43 return fCustomValuePtr;
44 }
45
46public:
47 RDefineReader(unsigned int slot, RDFDetail::RDefineBase &define, const std::type_info &tid)
48 : fDefine(define), fCustomValuePtr(define.GetValuePtr(slot)), fSlot(slot)
49 {
50 CheckDefineType(define, tid);
51 }
52};
53
54}
55}
56}
57
58#endif
long long Long64_t
Definition RtypesCore.h:73
virtual void Update(unsigned int slot, Long64_t entry)=0
Update the value at the address returned by GetValuePtr with the content corresponding to the given e...
Column reader for defined (aka custom) columns.
void * GetImpl(Long64_t entry) final
RDefineReader(unsigned int slot, RDFDetail::RDefineBase &define, const std::type_info &tid)
RDFDetail::RDefineBase & fDefine
Non-owning reference to the node responsible for the custom column. Needed when querying custom value...
void CheckDefineType(RDFDetail::RDefineBase &define, const std::type_info &tid)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...