Logo ROOT   6.07/09
Reference Guide
List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
ROOT::TExecutor< subc > Class Template Reference

template<class subc>
class ROOT::TExecutor< subc >

Definition at line 21 of file TExecutor.hxx.

Public Types

template<class F , class... T>
using noReferenceCond = typename std::enable_if<"Function can't return a reference"&&!(std::is_reference< typename std::result_of< F(T...)>::type >::value)>::type
 

Public Member Functions

 TExecutor ()=default
 
 TExecutor (size_t)
 
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 in parallel. More...
 
template<class F , class T , class Cond = noReferenceCond<F, typename T::value_type>>
auto Map (F func, T &args) -> std::vector< decltype(++(args.begin()), args.end(), func(args.front()))>
 
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 INTEGER , class R , class Cond = noReferenceCond<F, INTEGER>>
auto MapReduce (F func, ROOT::TSeq< INTEGER > args, R redfunc) -> typename std::result_of< F(INTEGER)>::type
 

Protected Member Functions

template<class T , class R >
auto Reduce (const std::vector< T > &objs, R redfunc) -> decltype(redfunc(objs))
 
template<class T , class BINARYOP >
auto Reduce (const std::vector< T > &objs, BINARYOP redfunc) -> decltype(redfunc(objs.front(), objs.front()))
 Check that redfunc has the right signature and call it on objs. More...
 

Private Member Functions

subc & Derived ()
 

#include <ROOT/TExecutor.hxx>

Member Typedef Documentation

template<class subc>
template<class F , class... T>
using ROOT::TExecutor< subc >::noReferenceCond = typename std::enable_if<"Function can't return a reference" && !(std::is_reference<typename std::result_of<F(T...)>::type>::value)>::type

Definition at line 27 of file TExecutor.hxx.

Constructor & Destructor Documentation

template<class subc>
ROOT::TExecutor< subc >::TExecutor ( )
explicitdefault
template<class subc>
ROOT::TExecutor< subc >::TExecutor ( size_t  )
inlineexplicit

Definition at line 24 of file TExecutor.hxx.

Member Function Documentation

template<class subc>
subc& ROOT::TExecutor< subc >::Derived ( )
inlineprivate

Definition at line 67 of file TExecutor.hxx.

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

Execute func (with no arguments) nTimes in parallel.

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 79 of file TExecutor.hxx.

template<class subc>
template<class F , class T , class Cond = noReferenceCond<F, typename T::value_type>>
auto ROOT::TExecutor< subc >::Map ( F  func,
T &  args 
) -> std::vector< decltype(++(args.begin()), args.end(), func(args.front()))>
template<class subc>
template<class F , class R , class Cond = noReferenceCond<F>>
auto ROOT::TExecutor< subc >::MapReduce ( F  func,
unsigned  nTimes,
R  redfunc 
) -> typename std::result_of< F()>::type
template<class subc>
template<class F , class INTEGER , class R , class Cond = noReferenceCond<F, INTEGER>>
auto ROOT::TExecutor< subc >::MapReduce ( F  func,
ROOT::TSeq< INTEGER >  args,
R  redfunc 
) -> typename std::result_of< F(INTEGER)>::type
template<class subc >
template<class T , class R >
auto ROOT::TExecutor< subc >::Reduce ( const std::vector< T > &  objs,
R  redfunc 
) -> decltype(redfunc(objs))
protected

Definition at line 167 of file TExecutor.hxx.

template<class subc >
template<class T , class BINARYOP >
auto ROOT::TExecutor< subc >::Reduce ( const std::vector< T > &  objs,
BINARYOP  redfunc 
) -> decltype(redfunc(objs.front(), objs.front()))
protected

Check that redfunc has the right signature and call it on objs.

Definition at line 159 of file TExecutor.hxx.


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