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

template<typename T>
class ROOT::Experimental::TDF::TResultProxy< T >

Smart pointer for the return type of actions.

A wrapper around the result of TDataFrame actions able to trigger calculations lazily.

Template Parameters
TType of the action result

A smart pointer which allows to access the result of a TDataFrame action. The methods of the encapsulated object can be accessed via the arrow operator. Upon invocation of the arrow operator or dereferencing (operator*), the loop on the events and calculations of all scheduled actions are executed if needed. It is possible to iterate on the result proxy if the proxied object is a collection.

for (auto& myItem : myResultProxy) { ... };

If iteration is not supported by the type of the proxied object, a compilation error is thrown.

Definition at line 25 of file TResultProxy.hxx.

Public Member Functions

 TResultProxy ()=delete
 
TIterationHelper< T >::Iterator_t begin ()
 Return an iterator to the beginning of the contained object if this makes sense, throw a compilation error otherwise. More...
 
TIterationHelper< T >::Iterator_t end ()
 Return an iterator to the end of the contained object if this makes sense, throw a compilation error otherwise. More...
 
const T & GetValue ()
 Get a const reference to the encapsulated object. More...
 
T & operator* ()
 Get a pointer to the encapsulated object. More...
 
T * operator-> ()
 Get a pointer to the encapsulated object. More...
 

Private Types

using ShrdPtrBool_t = std::shared_ptr< bool >
 
using SPT_t = std::shared_ptr< T >
 
using SPTLM_t = std::shared_ptr< TDFDetail::TLoopManager >
 
using WPTLM_t = std::weak_ptr< TDFDetail::TLoopManager >
 

Private Member Functions

 TResultProxy (const SPT_t &objPtr, const ShrdPtrBool_t &readiness, const SPTLM_t &firstData)
 
T * Get ()
 Get the pointer to the encapsulated result. More...
 
void TriggerRun ()
 Triggers the event loop in the TLoopManager instance to which it's associated via the fImplWeakPtr. More...
 

Private Attributes

WPTLM_t fImplWeakPtr
 Points to the TLoopManager at the root of the functional graph. More...
 
SPT_t fObjPtr
 Shared pointer encapsulating the wrapped result. More...
 
ShrdPtrBool_t fReadiness
 State registered also in the TLoopManager until the event loop is executed. More...
 

Friends

template<typename W >
TResultProxy< W > TDFDetail::MakeResultProxy (const std::shared_ptr< W > &, const SPTLM_t &)
 

#include <ROOT/TResultProxy.hxx>

Member Typedef Documentation

◆ ShrdPtrBool_t

template<typename T>
using ROOT::Experimental::TDF::TResultProxy< T >::ShrdPtrBool_t = std::shared_ptr<bool>
private

Definition at line 82 of file TResultProxy.hxx.

◆ SPT_t

template<typename T>
using ROOT::Experimental::TDF::TResultProxy< T >::SPT_t = std::shared_ptr<T>
private

Definition at line 79 of file TResultProxy.hxx.

◆ SPTLM_t

template<typename T>
using ROOT::Experimental::TDF::TResultProxy< T >::SPTLM_t = std::shared_ptr<TDFDetail::TLoopManager>
private

Definition at line 80 of file TResultProxy.hxx.

◆ WPTLM_t

template<typename T>
using ROOT::Experimental::TDF::TResultProxy< T >::WPTLM_t = std::weak_ptr<TDFDetail::TLoopManager>
private

Definition at line 81 of file TResultProxy.hxx.

Constructor & Destructor Documentation

◆ TResultProxy() [1/2]

template<typename T>
ROOT::Experimental::TDF::TResultProxy< T >::TResultProxy ( const SPT_t objPtr,
const ShrdPtrBool_t readiness,
const SPTLM_t firstData 
)
inlineprivate

Definition at line 103 of file TResultProxy.hxx.

◆ TResultProxy() [2/2]

template<typename T>
ROOT::Experimental::TDF::TResultProxy< T >::TResultProxy ( )
delete

Member Function Documentation

◆ begin()

template<typename T>
TIterationHelper<T>::Iterator_t ROOT::Experimental::TDF::TResultProxy< T >::begin ( )
inline

Return an iterator to the beginning of the contained object if this makes sense, throw a compilation error otherwise.

Definition at line 129 of file TResultProxy.hxx.

◆ end()

template<typename T>
TIterationHelper<T>::Iterator_t ROOT::Experimental::TDF::TResultProxy< T >::end ( )
inline

Return an iterator to the end of the contained object if this makes sense, throw a compilation error otherwise.

Definition at line 137 of file TResultProxy.hxx.

◆ Get()

template<typename T>
T* ROOT::Experimental::TDF::TResultProxy< T >::Get ( )
inlineprivate

Get the pointer to the encapsulated result.

Ownership is not transferred to the caller. Triggers event loop and execution of all actions booked in the associated TLoopManager.

Definition at line 97 of file TResultProxy.hxx.

◆ GetValue()

template<typename T>
const T& ROOT::Experimental::TDF::TResultProxy< T >::GetValue ( )
inline

Get a const reference to the encapsulated object.

Triggers event loop and execution of all actions booked in the associated TLoopManager.

Definition at line 113 of file TResultProxy.hxx.

◆ operator*()

template<typename T>
T& ROOT::Experimental::TDF::TResultProxy< T >::operator* ( )
inline

Get a pointer to the encapsulated object.

Triggers event loop and execution of all actions booked in the associated TLoopManager.

Definition at line 120 of file TResultProxy.hxx.

◆ operator->()

template<typename T>
T* ROOT::Experimental::TDF::TResultProxy< T >::operator-> ( )
inline

Get a pointer to the encapsulated object.

Ownership is not transferred to the caller. Triggers event loop and execution of all actions booked in the associated TLoopManager.

Definition at line 125 of file TResultProxy.hxx.

◆ TriggerRun()

template<typename T >
void ROOT::Experimental::TDF::TResultProxy< T >::TriggerRun ( )
private

Triggers the event loop in the TLoopManager instance to which it's associated via the fImplWeakPtr.

Definition at line 145 of file TResultProxy.hxx.

Friends And Related Function Documentation

◆ TDFDetail::MakeResultProxy

template<typename T>
template<typename W >
TResultProxy<W> TDFDetail::MakeResultProxy ( const std::shared_ptr< W > &  ,
const SPTLM_t  
)
friend

Member Data Documentation

◆ fImplWeakPtr

template<typename T>
WPTLM_t ROOT::Experimental::TDF::TResultProxy< T >::fImplWeakPtr
private

Points to the TLoopManager at the root of the functional graph.

Definition at line 88 of file TResultProxy.hxx.

◆ fObjPtr

template<typename T>
SPT_t ROOT::Experimental::TDF::TResultProxy< T >::fObjPtr
private

Shared pointer encapsulating the wrapped result.

Definition at line 89 of file TResultProxy.hxx.

◆ fReadiness

template<typename T>
ShrdPtrBool_t ROOT::Experimental::TDF::TResultProxy< T >::fReadiness
private
Initial value:
=
std::make_shared<bool>(false)

State registered also in the TLoopManager until the event loop is executed.

Definition at line 86 of file TResultProxy.hxx.


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