12 #ifndef ROOT_PoolUtils
13 #define ROOT_PoolUtils
28 namespace ExecutorUtils {
37 T operator()(
const std::vector<T> &objs){
38 static_assert(std::is_constructible<TObject *, T>::value,
39 "The argument should be a vector of pointers to TObject or derived classes");
49 ROOT::MergeFunc_t merge = obj->IsA()->GetMerge();
51 Error(
"PoolUtils::ReduceObjects",
"could not find merge method for the TObject\n. Aborting operation.");
57 unsigned NObjs = objs.size();
58 for(
unsigned i=1; i<NObjs; ++i)
59 mergelist.Add(objs[i]);
62 merge(obj, &mergelist,
nullptr);
73 namespace PoolUtils = ROOT::ExecutorUtils;
77 namespace ExecutorUtils {
80 template <
class O,
class F>
83 static O CastIfNeeded(O &&obj)
89 class ResultCaster<TObject *, F> {
91 static typename std::enable_if<std::is_pointer<F>::value, F>::type CastIfNeeded(TObject *obj)
93 return static_cast<F
>(obj);
98 namespace PoolUtils = ExecutorUtils;