Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RVariationReader.hxx
Go to the documentation of this file.
1// Author: Enrico Guiraud CERN 11/2021
2
3/*************************************************************************
4 * Copyright (C) 1995-2021, 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_RVARIATIONREADER
12#define ROOT_RDF_RVARIATIONREADER
13
14#include "RColumnReaderBase.hxx"
15#include "RVariationBase.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
25/// Column reader that reads the value for a specific column, variation and slot.
26class R__CLING_PTRCHECK(off) RVariationReader final : public ROOT::Detail::RDF::RColumnReaderBase {
28
29 /// Non-owning ptr to the value of the variation.
30 void *fValuePtr = nullptr;
31
32 /// The slot this value belongs to.
33 unsigned int fSlot = std::numeric_limits<unsigned int>::max();
34
35 void *GetImpl(Long64_t entry) final
36 {
37 fVariation->Update(fSlot, entry);
38 return fValuePtr;
39 }
40
41public:
42 RVariationReader(unsigned int slot, const std::string &colName, const std::string &variationName,
43 RVariationBase &variation)
44 : fVariation(&variation), fValuePtr(variation.GetValuePtr(slot, colName, variationName)), fSlot(slot)
45 {
46 }
47};
48
49} // namespace RDF
50} // namespace Internal
51} // namespace ROOT
52
53#endif
long long Long64_t
Definition RtypesCore.h:80
This type includes all parts of RVariation that do not depend on the callable signature.
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 that reads the value for a specific column, variation and slot.
RVariationReader(unsigned int slot, const std::string &colName, const std::string &variationName, RVariationBase &variation)
void * GetImpl(Long64_t entry) final
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.