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 "Utils.hxx" // CheckReaderTypeMatches
17#include <Rtypes.h> // Long64_t, R__CLING_PTRCHECK
18
19#include <limits>
20#include <type_traits>
21
22namespace ROOT {
23namespace Internal {
24namespace RDF {
25
27
28/// Column reader for defined (aka custom) columns.
29class R__CLING_PTRCHECK(off) RDefineReader final : public ROOT::Detail::RDF::RColumnReaderBase {
30 /// Non-owning reference to the node responsible for the custom column. Needed when querying custom values.
32
33 /// Non-owning ptr to the value of a custom column.
34 void *fCustomValuePtr = nullptr;
35
36 /// The slot this value belongs to.
37 unsigned int fSlot = std::numeric_limits<unsigned int>::max();
38
39 void *GetImpl(Long64_t entry) final
40 {
41 fDefine.Update(fSlot, entry);
42 return fCustomValuePtr;
43 }
44
45public:
46 RDefineReader(unsigned int slot, RDFDetail::RDefineBase &define, const std::type_info &tid)
47 : fDefine(define), fCustomValuePtr(define.GetValuePtr(slot)), fSlot(slot)
48 {
49 CheckReaderTypeMatches(define.GetTypeId(), tid, define.GetName(), "RDefineReader");
50 }
51};
52
53}
54}
55}
56
57#endif
long long Long64_t
Definition RtypesCore.h:80
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...
std::string GetName() const
virtual const std::type_info & GetTypeId() const =0
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 CheckReaderTypeMatches(const std::type_info &colType, const std::type_info &requestedType, const std::string &colName, const std::string &where)
Definition RDFUtils.cxx:386
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...