ROOT  6.06/09
Reference Guide
PoolUtils.h
Go to the documentation of this file.
1 /* @(#)root/multiproc:$Id$ */
2 // Author: Enrico Guiraud July 2015
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_PoolUtils
13 #define ROOT_PoolUtils
14 
15 #include "TObject.h"
16 #include <vector>
17 
18 namespace PoolCode {
19 
20  //////////////////////////////////////////////////////////////////////////
21  ///
22  /// An enumeration of the message codes handled by TPool, TPoolWorker and TPoolProcessor
23  ///
24  //////////////////////////////////////////////////////////////////////////
25 
26  enum EPoolCode : unsigned {
27  //not an enum class because we want to be able to easily cast back and forth from unsigned
28  /* TPool::Map */
29  kExecFunc = 0, ///< Execute function without arguments
30  kExecFuncWithArg, ///< Execute function with the argument contained in the message
31  kFuncResult, ///< The message contains the result of a function execution
32  /* TPool::MapReduce */
33  kIdling, ///< We are ready for the next task
34  kSendResult, ///< Ask for a kFuncResult/kProcResult
35  /* TPool::Process */
36  kProcFile, ///< Tell a TPoolProcessor which tree to process. The object sent is a TreeInfo
37  kProcRange, ///< Tell a TPoolProcessor which tree and entries range to process. The object sent is a TreeRangeInfo
38  kProcTree, ///< Tell a TPoolProcessor to process the tree that was passed to it at construction time
39  kProcResult, ///< The message contains the result of the processing of a TTree
40  kProcEnded, ///< Tell the client we are done processing (i.e. we have reached the target number of entries to process)
41  kProcError, ///< Tell the client there was an error while processing
42  };
43 
44 }
45 
46 //////////////////////////////////////////////////////////////////////////
47 ///
48 /// This namespace contains pre-defined functions to be used in
49 /// conjuction with TPool::Map and TPool::MapReduce.
50 ///
51 //////////////////////////////////////////////////////////////////////////
52 namespace PoolUtils {
53  TObject* ReduceObjects(const std::vector<TObject *>& objs);
54 }
55 
56 #endif
The message contains the result of a function execution.
Definition: PoolUtils.h:31
TObject * ReduceObjects(const std::vector< TObject * > &objs)
Merge collection of TObjects.
Definition: PoolUtils.cxx:11
Tell a TPoolProcessor to process the tree that was passed to it at construction time.
Definition: PoolUtils.h:38
Tell the client we are done processing (i.e. we have reached the target number of entries to process)...
Definition: PoolUtils.h:40
Tell a TPoolProcessor which tree and entries range to process. The object sent is a TreeRangeInfo...
Definition: PoolUtils.h:37
EPoolCode
An enumeration of the message codes handled by TPool, TPoolWorker and TPoolProcessor.
Definition: PoolUtils.h:26
Tell a TPoolProcessor which tree to process. The object sent is a TreeInfo.
Definition: PoolUtils.h:36
We are ready for the next task.
Definition: PoolUtils.h:33
This namespace contains pre-defined functions to be used in conjuction with TPool::Map and TPool::Map...
Definition: PoolUtils.h:52
Execute function with the argument contained in the message.
Definition: PoolUtils.h:30
The message contains the result of the processing of a TTree.
Definition: PoolUtils.h:39
Execute function without arguments.
Definition: PoolUtils.h:29
Tell the client there was an error while processing.
Definition: PoolUtils.h:41
Ask for a kFuncResult/kProcResult.
Definition: PoolUtils.h:34
Mother of all ROOT objects.
Definition: TObject.h:58