Logo ROOT   6.10/09
Reference Guide
List of all members | Public Member Functions | Private Types | Private Attributes | List of all members
ROOT::Internal::TDF::TColumnValue< T > Class Template Reference

template<typename T>
class ROOT::Internal::TDF::TColumnValue< T >

Helper class that updates and returns TTree branches as well as TDataFrame temporary columns.

Template Parameters
TThe type of the column

TDataFrame nodes must access two different types of values during the event loop: values of real branches, for which TTreeReader{Values,Arrays} act as proxies, or temporary columns whose values are generated on the fly. While the type of the value is known at compile time (or just-in-time), it is only at runtime that nodes can check whether a certain value is generated on the fly or not.

TColumnValuePtr abstracts this difference by providing the same interface for both cases and handling the reading or generation of new values transparently. Only one of the two data members fReaderProxy or fValuePtr will be non-null for a given TColumnValue, depending on whether the value comes from a real TTree branch or from a temporary column respectively.

TDataFrame nodes can store tuples of TColumnValues and retrieve an updated value for the column via the Get method.

Definition at line 131 of file TDFNodes.hxx.

Public Member Functions

 TColumnValue ()=default
 
template<typename U = T, typename std::enable_if< std::is_same< typename TColumnValue< U >::ProxyParam_t, U >::value, int >::type = 0>
T & Get (Long64_t entry)
 
template<typename U = T, typename std::enable_if<!std::is_same< ProxyParam_t, U >::value, int >::type = 0>
std::array_view< ProxyParam_tGet (Long64_t)
 
void MakeProxy (TTreeReader *r, const std::string &bn)
 
void Reset ()
 
void SetTmpColumn (unsigned int slot, TCustomColumnBase *tmpColumn)
 

Private Types

using ProxyParam_t = typename std::conditional< std::is_same< ReaderValueOrArray_t< T >, TTreeReaderValue< T > >::value, T, ExtractType_t< T > >::type
 

Private Attributes

std::unique_ptr< TTreeReaderArray< ProxyParam_t > > fReaderArray {nullptr}
 non-temporary columns and T != std::array_view<U> More...
 
std::unique_ptr< TTreeReaderValue< T > > fReaderValue {nullptr}
 
unsigned int fSlot {0}
 
TCustomColumnBasefTmpColumn {nullptr}
 
T * fValuePtr {nullptr}
 non-temporary columsn and T == std::array_view<U>. More...
 

#include <ROOT/TDFNodes.hxx>

Member Typedef Documentation

◆ ProxyParam_t

template<typename T >
using ROOT::Internal::TDF::TColumnValue< T >::ProxyParam_t = typename std::conditional<std::is_same<ReaderValueOrArray_t<T>, TTreeReaderValue<T> >::value, T, ExtractType_t<T> >::type
private

Definition at line 135 of file TDFNodes.hxx.

Constructor & Destructor Documentation

◆ TColumnValue()

template<typename T >
ROOT::Internal::TDF::TColumnValue< T >::TColumnValue ( )
default

Member Function Documentation

◆ Get() [1/2]

template<typename T >
template<typename U , typename std::enable_if< std::is_same< typename ROOT::Internal::TDF::TColumnValue< U >::ProxyParam_t, U >::value, int >::type >
T & ROOT::Internal::TDF::TColumnValue< T >::Get ( Long64_t  entry)

Definition at line 593 of file TDFNodes.hxx.

◆ Get() [2/2]

template<typename T >
template<typename U = T, typename std::enable_if<!std::is_same< ProxyParam_t, U >::value, int >::type = 0>
std::array_view<ProxyParam_t> ROOT::Internal::TDF::TColumnValue< T >::Get ( Long64_t  )
inline

Definition at line 165 of file TDFNodes.hxx.

◆ MakeProxy()

template<typename T >
void ROOT::Internal::TDF::TColumnValue< T >::MakeProxy ( TTreeReader r,
const std::string &  bn 
)
inline

Definition at line 150 of file TDFNodes.hxx.

◆ Reset()

template<typename T >
void ROOT::Internal::TDF::TColumnValue< T >::Reset ( void  )
inline

Definition at line 179 of file TDFNodes.hxx.

◆ SetTmpColumn()

template<typename T >
void ROOT::Internal::TDF::TColumnValue< T >::SetTmpColumn ( unsigned int  slot,
TCustomColumnBase tmpColumn 
)

Definition at line 573 of file TDFNodes.hxx.

Member Data Documentation

◆ fReaderArray

template<typename T >
std::unique_ptr<TTreeReaderArray<ProxyParam_t> > ROOT::Internal::TDF::TColumnValue< T >::fReaderArray {nullptr}
private

non-temporary columns and T != std::array_view<U>

Definition at line 138 of file TDFNodes.hxx.

◆ fReaderValue

template<typename T >
std::unique_ptr<TTreeReaderValue<T> > ROOT::Internal::TDF::TColumnValue< T >::fReaderValue {nullptr}
private

Definition at line 136 of file TDFNodes.hxx.

◆ fSlot

template<typename T >
unsigned int ROOT::Internal::TDF::TColumnValue< T >::fSlot {0}
private

Definition at line 143 of file TDFNodes.hxx.

◆ fTmpColumn

template<typename T >
TCustomColumnBase* ROOT::Internal::TDF::TColumnValue< T >::fTmpColumn {nullptr}
private

Definition at line 142 of file TDFNodes.hxx.

◆ fValuePtr

template<typename T >
T* ROOT::Internal::TDF::TColumnValue< T >::fValuePtr {nullptr}
private

non-temporary columsn and T == std::array_view<U>.

Definition at line 141 of file TDFNodes.hxx.


The documentation for this class was generated from the following file: