Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 09:14:16

0001 // Author: Enrico Guiraud CERN 09/2020
0002 
0003 /*************************************************************************
0004  * Copyright (C) 1995-2020, Rene Brun and Fons Rademakers.               *
0005  * All rights reserved.                                                  *
0006  *                                                                       *
0007  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0008  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0009  *************************************************************************/
0010 
0011 #ifndef ROOT_INTERNAL_RDF_RCOLUMNREADERBASE
0012 #define ROOT_INTERNAL_RDF_RCOLUMNREADERBASE
0013 
0014 #include <Rtypes.h>
0015 
0016 namespace ROOT {
0017 namespace Detail {
0018 namespace RDF {
0019 
0020 /**
0021 \class ROOT::Internal::RDF::RColumnReaderBase
0022 \ingroup dataframe
0023 \brief Pure virtual base class for all column reader types
0024 
0025 This pure virtual class provides a common base class for the different column reader types, e.g. RTreeColumnReader and
0026 RDSColumnReader.
0027 **/
0028 class R__CLING_PTRCHECK(off) RColumnReaderBase {
0029 public:
0030    virtual ~RColumnReaderBase() = default;
0031 
0032    /// Return the column value for the given entry.
0033    /// \tparam T The column type
0034    /// \param entry The entry number
0035    ///
0036    /// The caller is responsible for checking that the returned value actually
0037    /// exists.
0038    template <typename T>
0039    T *TryGet(Long64_t entry)
0040    {
0041       return static_cast<T *>(GetImpl(entry));
0042    }
0043 
0044 private:
0045    virtual void *GetImpl(Long64_t entry) = 0;
0046 };
0047 
0048 } // namespace RDF
0049 } // namespace Detail
0050 } // namespace ROOT
0051 
0052 #endif