Logo ROOT  
Reference Guide
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
27/// Column reader for defined columns.
28class R__CLING_PTRCHECK(off) RDefineReader final : public ROOT::Detail::RDF::RColumnReaderBase {
29 /// Non-owning reference to the node responsible for the defined column.
31
32 /// Non-owning ptr to the defined value.
33 void *fValuePtr = nullptr;
34
35 /// The slot this value belongs to.
36 unsigned int fSlot = std::numeric_limits<unsigned int>::max();
37
38 void *GetImpl(Long64_t entry) final
39 {
40 fDefine.Update(fSlot, entry);
41 return fValuePtr;
42 }
43
44public:
45 RDefineReader(unsigned int slot, RDFDetail::RDefineBase &define)
46 : fDefine(define), fValuePtr(define.GetValuePtr(slot)), fSlot(slot)
47 {
48 }
49};
50
51}
52}
53}
54
55#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...
Column reader for defined columns.
void * GetImpl(Long64_t entry) final
RDefineReader(unsigned int slot, RDFDetail::RDefineBase &define)
RDFDetail::RDefineBase & fDefine
Non-owning reference to the node responsible for the defined column.
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.