Logo ROOT   6.19/01
Reference Guide
ROOT::TSequentialExecutor Class Reference

Definition at line 22 of file TSequentialExecutor.hxx.

Public Member Functions

 TSequentialExecutor ()
 
 TSequentialExecutor (TSequentialExecutor &)=delete
 
template<class F >
void Foreach (F func, unsigned nTimes)
 Execute func (with no arguments) nTimes. More...
 
template<class F , class INTEGER >
void Foreach (F func, ROOT::TSeq< INTEGER > args)
 Execute func, taking an element of a sequence as argument. More...
 
template<class F , class T >
void Foreach (F func, std::vector< T > &args)
 Execute func, taking an element of an std::vector as argument. More...
 
template<class F , class Cond = noReferenceCond<F>>
auto Map (F func, unsigned nTimes) -> std::vector< typename std::result_of< F()>::type >
 Execute func (with no arguments) nTimes. More...
 
template<class F , class INTEGER , class Cond = noReferenceCond<F, INTEGER>>
auto Map (F func, ROOT::TSeq< INTEGER > args) -> std::vector< typename std::result_of< F(INTEGER)>::type >
 Execute func, taking an element of a sequence as argument. More...
 
template<class F , class T , class Cond = noReferenceCond<F, T>>
auto Map (F func, std::vector< T > &args) -> std::vector< typename std::result_of< F(T)>::type >
 Execute func, taking an element of an std::vector as argument. More...
 
template<class F , class R , class Cond = noReferenceCond<F>>
auto MapReduce (F func, unsigned nTimes, R redfunc) -> typename std::result_of< F()>::type
 
template<class F , class T , class R , class Cond = noReferenceCond<F, T>>
auto MapReduce (F func, std::vector< T > &args, R redfunc) -> typename std::result_of< F(T)>::type
 
TSequentialExecutoroperator= (TSequentialExecutor &)=delete
 
template<class T , class R >
auto Reduce (const std::vector< T > &objs, R redfunc) -> decltype(redfunc(objs))
 "Reduce" an std::vector into a single object by passing a function as the second argument defining the reduction operation. More...
 
- Public Member Functions inherited from ROOT::TExecutor< TSequentialExecutor >
 TExecutor ()=default
 
 TExecutor (size_t)
 
auto Map (F func, unsigned nTimes) -> std::vector< typename std::result_of< F()>::type >
 Execute func (with no arguments) nTimes in parallel. More...
 
auto Map (F func, ROOT::TSeq< INTEGER > args) -> std::vector< typename std::result_of< F(INTEGER)>::type >
 Execute func in parallel, taking an element of a sequence as argument. More...
 
auto Map (F func, std::vector< T > &args) -> std::vector< typename std::result_of< F(T)>::type >
 Execute func in parallel, taking an element of an std::vector as argument. More...
 
auto Map (F func, std::initializer_list< T > args) -> std::vector< typename std::result_of< F(T)>::type >
 Execute func in parallel, taking an element of the std::initializer_list as argument. More...
 
auto MapReduce (F func, ROOT::TSeq< INTEGER > args, R redfunc) -> typename std::result_of< F(INTEGER)>::type
 This method behaves just like Map, but an additional redfunc function must be provided. More...
 
T * MapReduce (F func, std::vector< T * > &args)
 
auto MapReduce (F func, std::initializer_list< T > args, R redfunc) -> typename std::result_of< F(T)>::type
 
T * Reduce (const std::vector< T * > &mergeObjs)
 "Reduce" an std::vector into a single object by using the object's Merge More...
 

Additional Inherited Members

- Public Types inherited from ROOT::TExecutor< TSequentialExecutor >
using noReferenceCond = typename std::enable_if<"Function can't return a reference" &&!(std::is_reference< typename std::result_of< F(T...)>::type >::value)>::type
 

#include <ROOT/TSequentialExecutor.hxx>

Inheritance diagram for ROOT::TSequentialExecutor:
[legend]

Constructor & Destructor Documentation

◆ TSequentialExecutor() [1/2]

ROOT::TSequentialExecutor::TSequentialExecutor ( )
inlineexplicit

Definition at line 24 of file TSequentialExecutor.hxx.

◆ TSequentialExecutor() [2/2]

ROOT::TSequentialExecutor::TSequentialExecutor ( TSequentialExecutor )
delete

Member Function Documentation

◆ Foreach() [1/3]

template<class F >
void ROOT::TSequentialExecutor::Foreach ( F  func,
unsigned  nTimes 
)

Execute func (with no arguments) nTimes.

Functions that take more than zero arguments can be executed (with fixed arguments) by wrapping them in a lambda or with std::bind.

Definition at line 69 of file TSequentialExecutor.hxx.

◆ Foreach() [2/3]

template<class F , class INTEGER >
void ROOT::TSequentialExecutor::Foreach ( F  func,
ROOT::TSeq< INTEGER >  args 
)

Execute func, taking an element of a sequence as argument.

Definition at line 77 of file TSequentialExecutor.hxx.

◆ Foreach() [3/3]

template<class F , class T >
void ROOT::TSequentialExecutor::Foreach ( F  func,
std::vector< T > &  args 
)

Execute func, taking an element of an std::vector as argument.

Definition at line 96 of file TSequentialExecutor.hxx.

◆ Map() [1/3]

template<class F , class Cond >
auto ROOT::TSequentialExecutor::Map ( F  func,
unsigned  nTimes 
) -> std::vector<typename std::result_of<F()>::type>

Execute func (with no arguments) nTimes.

A vector containg executions' results is returned. Functions that take more than zero arguments can be executed (with fixed arguments) by wrapping them in a lambda or with std::bind.

Definition at line 107 of file TSequentialExecutor.hxx.

◆ Map() [2/3]

template<class F , class INTEGER , class Cond >
auto ROOT::TSequentialExecutor::Map ( F  func,
ROOT::TSeq< INTEGER >  args 
) -> std::vector<typename std::result_of<F(INTEGER)>::type>

Execute func, taking an element of a sequence as argument.

A vector containg executions' results is returned.

Definition at line 119 of file TSequentialExecutor.hxx.

◆ Map() [3/3]

template<class F , class T , class Cond >
auto ROOT::TSequentialExecutor::Map ( F  func,
std::vector< T > &  args 
) -> std::vector<typename std::result_of<F(T)>::type>

Execute func, taking an element of an std::vector as argument.

A vector containg executions' results is returned.

Definition at line 133 of file TSequentialExecutor.hxx.

◆ MapReduce() [1/2]

template<class F , class R , class Cond >
auto ROOT::TSequentialExecutor::MapReduce ( F  func,
unsigned  nTimes,
R  redfunc 
) -> typename std::result_of<F()>::type

Definition at line 143 of file TSequentialExecutor.hxx.

◆ MapReduce() [2/2]

template<class F , class T , class R , class Cond >
auto ROOT::TSequentialExecutor::MapReduce ( F  func,
std::vector< T > &  args,
R  redfunc 
) -> typename std::result_of<F(T)>::type

Definition at line 148 of file TSequentialExecutor.hxx.

◆ operator=()

TSequentialExecutor& ROOT::TSequentialExecutor::operator= ( TSequentialExecutor )
delete

◆ Reduce()

template<class T , class R >
auto ROOT::TSequentialExecutor::Reduce ( const std::vector< T > &  objs,
R  redfunc 
) -> decltype(redfunc(objs))

"Reduce" an std::vector into a single object by passing a function as the second argument defining the reduction operation.

Definition at line 156 of file TSequentialExecutor.hxx.


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