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, const std::type_info &tid)
44 : fVariation(&variation), fValuePtr(variation.GetValuePtr(slot, colName, variationName)), fSlot(slot)
45 {
46 CheckReaderTypeMatches(variation.GetTypeId(), tid, colName, "RVariationReader");
47 }
48};
49
50} // namespace RDF
51} // namespace Internal
52} // namespace ROOT
53
54#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 const std::type_info & GetTypeId() const =0
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, const std::type_info &tid)
void * GetImpl(Long64_t entry) final
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...