11#ifndef ROOT_RRESULTPTR 
   12#define ROOT_RRESULTPTR 
   43RResultPtr<T> 
MakeResultPtr(
const std::shared_ptr<T> &
r, RLoopManager &df,
 
   44                            std::shared_ptr<ROOT::Internal::RDF::RActionBase> actionPtr);
 
   74   using SPT_t = std::shared_ptr<T>;
 
   77   template <
typename T1>
 
   79                                                  std::shared_ptr<RDFInternal::RActionBase>);
 
   80   template <
class T1, 
class T2>
 
   82   template <
class T1, 
class T2>
 
   96   template <typename V, bool hasBeginEnd = TTraits::HasBeginAndEnd<V>::value>
 
   97   struct RIterationHelper {
 
   98      using Iterator_t = 
void;
 
   99      void GetBegin(
const V &) { 
static_assert(
sizeof(V) == 0, 
"It does not make sense to ask begin for this class."); }
 
  100      void GetEnd(
const V &) { 
static_assert(
sizeof(V) == 0, 
"It does not make sense to ask end for this class."); }
 
  103   template <
typename V>
 
  104   struct RIterationHelper<V, true> {
 
  105      using Iterator_t = 
decltype(std::begin(std::declval<V>()));
 
  106      static Iterator_t GetBegin(
const V &
v) { 
return std::begin(
v); };
 
  107      static Iterator_t GetEnd(
const V &
v) { 
return std::end(
v); };
 
  133              std::shared_ptr<RDFInternal::RActionBase> actionPtr)
 
  147   explicit operator bool()
 const { 
return bool(
fObjPtr); }
 
  168   typename RIterationHelper<T>::Iterator_t 
begin()
 
  172      return RIterationHelper<T>::GetBegin(*
fObjPtr);
 
  177   typename RIterationHelper<T>::Iterator_t 
end()
 
  181      return RIterationHelper<T>::GetEnd(*
fObjPtr);
 
  230      auto c = [nSlots, actionPtr, callback](
unsigned int slot) {
 
  231         if (slot != nSlots - 1)
 
  233         auto partialResult = 
static_cast<Value_t *
>(actionPtr->PartialUpdate(slot));
 
  234         callback(*partialResult);
 
  274      auto c = [actionPtr, callback](
unsigned int slot) {
 
  275         auto partialResult = 
static_cast<Value_t *
>(actionPtr->PartialUpdate(slot));
 
  276         callback(slot, *partialResult);
 
  289template <
class T1, 
class T2>
 
  295template <
class T1, 
class T2>
 
unsigned long long ULong64_t
typedef void((*Func_t)())
The head node of a RDF computation graph.
void Run()
Start the event loop with a different mechanism depending on IMT/no IMT, data source/no data source.
unsigned int GetNSlots() const
void RegisterCallback(ULong64_t everyNEvents, std::function< void(unsigned int)> &&f)
Helper class that provides the operation graph nodes.
Smart pointer for the return type of actions.
void TriggerRun()
Triggers the event loop in the RLoopManager.
RResultPtr(RResultPtr &&)=default
T * GetPtr()
Get the pointer to the encapsulated object.
RResultPtr< T > & OnPartialResult(ULong64_t everyNEvents, std::function< void(T &)> callback)
Register a callback that RDataFrame will execute "everyNEvents" on a partial result.
RDFDetail::RLoopManager * fLoopManager
Non-owning pointer to the RLoopManager at the root of this computation graph.
friend bool operator!=(const RResultPtr< T1 > &lhs, const RResultPtr< T2 > &rhs)
RIterationHelper< T >::Iterator_t begin()
Return an iterator to the beginning of the contained object if this makes sense, throw a compilation ...
T Value_t
Convenience alias to simplify access to proxied type.
T * Get()
Get the pointer to the encapsulated result.
const T & GetValue()
Get a const reference to the encapsulated object.
RResultPtr(const RResultPtr &)=default
T & operator*()
Get a pointer to the encapsulated object.
RResultPtr & operator=(const RResultPtr &)=default
RResultPtr< T > & OnPartialResultSlot(ULong64_t everyNEvents, std::function< void(unsigned int, T &)> callback)
Register a callback that RDataFrame will execute in each worker thread concurrently on that thread's ...
RResultPtr & operator=(RResultPtr &&)=default
friend bool operator==(const RResultPtr< T1 > &lhs, const RResultPtr< T2 > &rhs)
std::shared_ptr< RDFInternal::RActionBase > fActionPtr
Owning pointer to the action that will produce this result.
std::shared_ptr< T > SPT_t
T * operator->()
Get a pointer to the encapsulated object.
SPT_t fObjPtr
Shared pointer encapsulating the wrapped result.
static constexpr ULong64_t kOnce
Convenience definition to express a callback must be executed once.
RResultPtr(std::shared_ptr< T > objPtr, RDFDetail::RLoopManager *lm, std::shared_ptr< RDFInternal::RActionBase > actionPtr)
RIterationHelper< T >::Iterator_t end()
Return an iterator to the end of the contained object if this makes sense, throw a compilation error ...
RResultPtr< T > MakeResultPtr(const std::shared_ptr< T > &r, RLoopManager &df, std::shared_ptr< ROOT::Internal::RDF::RActionBase > actionPtr)
Create a RResultPtr and set its pointer to the corresponding RAction This overload is invoked by non-...
bool operator!=(const RResultPtr< T1 > &lhs, const RResultPtr< T2 > &rhs)
bool operator==(const RResultPtr< T1 > &lhs, const RResultPtr< T2 > &rhs)
void function(const Char_t *name_, T fun, const Char_t *docstring=0)
ROOT type_traits extensions.
Namespace for new ROOT classes and functions.