Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RColumnReaderBase.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_INTERNAL_RDF_RCOLUMNREADERBASE
12#define ROOT_INTERNAL_RDF_RCOLUMNREADERBASE
13
14#include <Rtypes.h>
15
16namespace ROOT {
17namespace Detail {
18namespace RDF {
19
20/**
21\class ROOT::Internal::RDF::RColumnReaderBase
22\ingroup dataframe
23\brief Pure virtual base class for all column reader types
24
25This pure virtual class provides a common base class for the different column reader types, e.g. RTreeColumnReader and
26RDSColumnReader.
27**/
28class R__CLING_PTRCHECK(off) RColumnReaderBase {
29public:
30 virtual ~RColumnReaderBase() = default;
31
32 /// Return the column value for the given entry.
33 /// \tparam T The column type
34 /// \param entry The entry number
35 template <typename T>
36 T &Get(Long64_t entry)
37 {
38 return *static_cast<T *>(GetImpl(entry));
39 }
40
41private:
42 virtual void *GetImpl(Long64_t entry) = 0;
43};
44
45} // namespace RDF
46} // namespace Detail
47} // namespace ROOT
48
49#endif
long long Long64_t
Definition RtypesCore.h:80
virtual void * GetImpl(Long64_t entry)=0
T & Get(Long64_t entry)
Return the column value for the given entry.
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.