ROOT  6.06/09
Reference Guide
Public Member Functions | Private Member Functions | Private Attributes | List of all members
TPoolProcessor< F > Class Template Reference

template<class F>
class TPoolProcessor< F >

Definition at line 71 of file TPoolProcessor.h.

Public Member Functions

 TPoolProcessor (F procFunc, const std::vector< std::string > &fileNames, const std::string &treeName, unsigned nWorkers, ULong64_t maxEntries)
 
 TPoolProcessor (F procFunc, TTree *tree, unsigned nWorkers, ULong64_t maxEntries)
 
 ~TPoolProcessor ()
 
void HandleInput (MPCodeBufPair &msg)
 Execute instructions received from a TPool client. More...
 
void Init (int fd, unsigned workerN)
 This method is called by children processes right after forking. More...
 
- Public Member Functions inherited from TMPWorker
 TMPWorker ()
 Class constructor. More...
 
virtual ~TMPWorker ()
 
 TMPWorker (const TMPWorker &)=delete
 
TMPWorkeroperator= (const TMPWorker &)=delete
 
void Run ()
 
TSocketGetSocket ()
 
pid_t GetPid ()
 
unsigned GetNWorker () const
 

Private Member Functions

void Process (unsigned code, MPCodeBufPair &msg)
 
TFileOpenFile (const std::string &fileName)
 
TTreeRetrieveTree (TFile *fp)
 
ULong64_t EvalMaxEntries (ULong64_t maxEntries)
 

Private Attributes

F fProcFunc
 the function to be executed More...
 
std::vector< std::string > fFileNames
 the files to be processed by all workers More...
 
std::string fTreeName
 the name of the tree to be processed More...
 
TTreefTree
 pointer to the tree to be processed. It is only used if the tree is directly passed to TProcPool::Process as argument More...
 
unsigned fNWorkers
 the number of workers spawned More...
 
ULong64_t fMaxNEntries
 the maximum number of entries to be processed by this worker More...
 
ULong64_t fProcessedEntries
 the number of entries processed by this worker so far More...
 
std::result_of< F(std::reference_wrapper< TTreeReader >)>::type fReducedResult
 the results of the executions of fProcFunc merged together More...
 
bool fCanReduce
 true if fReducedResult can be reduced with a new result, false until we have produced one result More...
 

#include <TPoolProcessor.h>

+ Inheritance diagram for TPoolProcessor< F >:
+ Collaboration diagram for TPoolProcessor< F >:

Constructor & Destructor Documentation

template<class F >
TPoolProcessor< F >::TPoolProcessor ( F  procFunc,
const std::vector< std::string > &  fileNames,
const std::string &  treeName,
unsigned  nWorkers,
ULong64_t  maxEntries 
)

Definition at line 99 of file TPoolProcessor.h.

template<class F >
TPoolProcessor< F >::TPoolProcessor ( F  procFunc,
TTree tree,
unsigned  nWorkers,
ULong64_t  maxEntries 
)

Definition at line 107 of file TPoolProcessor.h.

template<class F>
TPoolProcessor< F >::~TPoolProcessor ( )
inline

Definition at line 75 of file TPoolProcessor.h.

Member Function Documentation

template<class F >
ULong64_t TPoolProcessor< F >::EvalMaxEntries ( ULong64_t  maxEntries)
private

Definition at line 306 of file TPoolProcessor.h.

template<class F >
void TPoolProcessor< F >::HandleInput ( MPCodeBufPair msg)
virtual

Execute instructions received from a TPool client.

Reimplemented from TMPWorker.

Definition at line 116 of file TPoolProcessor.h.

template<class F >
void TPoolProcessor< F >::Init ( int  fd,
unsigned  workerN 
)
virtual

This method is called by children processes right after forking.

Initialization of worker properties that must be delayed until after forking must be done here.
For example, Init saves the pid into fPid, and adds the TMPWorker to the main eventloop (as a TFileHandler).
Make sure this operations are performed also by overriding implementations, e.g. by calling TMPWorker::Init explicitly.

Reimplemented from TMPWorker.

Definition at line 138 of file TPoolProcessor.h.

template<class F >
TFile * TPoolProcessor< F >::OpenFile ( const std::string &  fileName)
private

Definition at line 257 of file TPoolProcessor.h.

template<class F >
void TPoolProcessor< F >::Process ( unsigned  code,
MPCodeBufPair msg 
)
private

Definition at line 146 of file TPoolProcessor.h.

template<class F >
TTree * TPoolProcessor< F >::RetrieveTree ( TFile fp)
private

Definition at line 274 of file TPoolProcessor.h.

Member Data Documentation

template<class F>
bool TPoolProcessor< F >::fCanReduce
private

true if fReducedResult can be reduced with a new result, false until we have produced one result

Definition at line 94 of file TPoolProcessor.h.

template<class F>
std::vector<std::string> TPoolProcessor< F >::fFileNames
private

the files to be processed by all workers

Definition at line 87 of file TPoolProcessor.h.

template<class F>
ULong64_t TPoolProcessor< F >::fMaxNEntries
private

the maximum number of entries to be processed by this worker

Definition at line 91 of file TPoolProcessor.h.

template<class F>
unsigned TPoolProcessor< F >::fNWorkers
private

the number of workers spawned

Definition at line 90 of file TPoolProcessor.h.

template<class F>
ULong64_t TPoolProcessor< F >::fProcessedEntries
private

the number of entries processed by this worker so far

Definition at line 92 of file TPoolProcessor.h.

template<class F>
F TPoolProcessor< F >::fProcFunc
private

the function to be executed

Definition at line 86 of file TPoolProcessor.h.

template<class F>
std::result_of<F(std::reference_wrapper<TTreeReader>)>::type TPoolProcessor< F >::fReducedResult
private

the results of the executions of fProcFunc merged together

Definition at line 93 of file TPoolProcessor.h.

template<class F>
TTree* TPoolProcessor< F >::fTree
private

pointer to the tree to be processed. It is only used if the tree is directly passed to TProcPool::Process as argument

Definition at line 89 of file TPoolProcessor.h.

template<class F>
std::string TPoolProcessor< F >::fTreeName
private

the name of the tree to be processed

Definition at line 88 of file TPoolProcessor.h.


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