Logo ROOT   6.12/07
Reference Guide
List of all members | Public Member Functions | Private Member Functions | Private Attributes | List of all members
TMPWorkerTreeFunc< F > Class Template Reference

template<class F>
class TMPWorkerTreeFunc< F >

Templated derivation of TMPWorkerTree handlign generic function tree processing.

Definition at line 79 of file TMPWorkerTree.h.

Public Member Functions

 TMPWorkerTreeFunc (F procFunc, const std::vector< std::string > &fileNames, TEntryList *entries, const std::string &treeName, UInt_t nWorkers, ULong64_t maxEntries, ULong64_t firstEntry)
 
 TMPWorkerTreeFunc (F procFunc, TTree *tree, TEntryList *entries, UInt_t nWorkers, ULong64_t maxEntries, ULong64_t firstEntry)
 
virtual ~TMPWorkerTreeFunc ()
 
- Public Member Functions inherited from TMPWorkerTree
 TMPWorkerTree ()
 Class constructors. More...
 
 TMPWorkerTree (const std::vector< std::string > &fileNames, TEntryList *entries, const std::string &treeName, UInt_t nWorkers, ULong64_t maxEntries, ULong64_t firstEntry)
 
 TMPWorkerTree (TTree *tree, TEntryList *entries, UInt_t nWorkers, ULong64_t maxEntries, ULong64_t firstEntry)
 
 TMPWorkerTree (const TMPWorkerTree &)=delete
 
virtual ~TMPWorkerTree ()
 
TMPWorkerTreeoperator= (const TMPWorkerTree &)=delete
 
- Public Member Functions inherited from TMPWorker
 TMPWorker ()
 
 TMPWorker (unsigned nWorkers, ULong64_t maxEntries)
 
 TMPWorker (const TMPWorker &)=delete
 
virtual ~TMPWorker ()
 
unsigned GetNWorker () const
 
pid_t GetPid ()
 
TSocketGetSocket ()
 
virtual void Init (int fd, unsigned workerN)
 This method is called by children processes right after forking. More...
 
TMPWorkeroperator= (const TMPWorker &)=delete
 
void Run ()
 

Private Member Functions

void Process (UInt_t code, MPCodeBufPair &msg)
 
void SendResult ()
 Generic function processing SendResult and Process overload. More...
 

Private Attributes

bool fCanReduce
 true if fReducedResult can be reduced with a new result, false until we have produced one result More...
 
F fProcFunc
 copy the function to be executed More...
 
std::result_of< F(std::reference_wrapper< TTreeReader >)>::type fReducedResult
 the results of the executions of fProcFunc merged together More...
 

Additional Inherited Members

- Protected Member Functions inherited from TMPWorkerTree
void CloseFile ()
 Handle file closing. More...
 
ULong64_t EvalMaxEntries (ULong64_t maxEntries)
 Max entries evaluation. More...
 
void HandleInput (MPCodeBufPair &msg)
 Execute instructions received from a MP client. More...
 
void Init (int fd, UInt_t workerN)
 Init overload definign max entries. More...
 
Int_t LoadTree (UInt_t code, MPCodeBufPair &msg, Long64_t &start, Long64_t &finish, TEntryList **enl, std::string &errmsg)
 Load the requierd tree and evaluate the processing range. More...
 
TFileOpenFile (const std::string &fileName)
 Handle file opening. More...
 
TTreeRetrieveTree (TFile *fp)
 Retrieve a tree from an open file. More...
 
void Setup ()
 Auxilliary method for common initializations. More...
 
void SetupTreeCache (TTree *tree)
 Tree cache handling. More...
 
- Protected Member Functions inherited from TMPWorker
void SendError (const std::string &errmsg, unsigned int code=MPCode::kError)
 Error sender. More...
 
- Protected Attributes inherited from TMPWorkerTree
TEntryListfEntryList
 entrylist More...
 
TFilefFile
 last open file More...
 
std::vector< std::string > fFileNames
 the files to be processed by all workers More...
 
ULong64_t fFirstEntry
 first entry to br processed More...
 
TTreefTree
 pointer to the tree to be processed. It is only used if the tree is directly passed to TProcessExecutor::Process as argument More...
 
std::string fTreeName
 the name of the tree to be processed More...
 
- Protected Attributes inherited from TMPWorker
std::string fId
 identifier string in the form W<nwrk>|P<proc id>=""> More...
 
ULong64_t fMaxNEntries
 the maximum number of entries to be processed by this worker More...
 
unsigned fNWorkers
 the number of workers spawned More...
 
ULong64_t fProcessedEntries
 the number of entries processed by this worker so far More...
 

#include <TMPWorkerTree.h>

Inheritance diagram for TMPWorkerTreeFunc< F >:
[legend]

Constructor & Destructor Documentation

◆ TMPWorkerTreeFunc() [1/2]

template<class F>
TMPWorkerTreeFunc< F >::TMPWorkerTreeFunc ( F  procFunc,
const std::vector< std::string > &  fileNames,
TEntryList entries,
const std::string &  treeName,
UInt_t  nWorkers,
ULong64_t  maxEntries,
ULong64_t  firstEntry 
)
inline

Definition at line 81 of file TMPWorkerTree.h.

◆ TMPWorkerTreeFunc() [2/2]

template<class F>
TMPWorkerTreeFunc< F >::TMPWorkerTreeFunc ( F  procFunc,
TTree tree,
TEntryList entries,
UInt_t  nWorkers,
ULong64_t  maxEntries,
ULong64_t  firstEntry 
)
inline

Definition at line 87 of file TMPWorkerTree.h.

◆ ~TMPWorkerTreeFunc()

template<class F>
virtual TMPWorkerTreeFunc< F >::~TMPWorkerTreeFunc ( )
inlinevirtual

Definition at line 93 of file TMPWorkerTree.h.

Member Function Documentation

◆ Process()

template<class F >
void TMPWorkerTreeFunc< F >::Process ( UInt_t  code,
MPCodeBufPair msg 
)
privatevirtual

Reimplemented from TMPWorkerTree.

Definition at line 187 of file TMPWorkerTree.h.

◆ SendResult()

template<class F >
void TMPWorkerTreeFunc< F >::SendResult ( )
privatevirtual

Generic function processing SendResult and Process overload.

Reimplemented from TMPWorkerTree.

Definition at line 180 of file TMPWorkerTree.h.

Member Data Documentation

◆ fCanReduce

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

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

Definition at line 101 of file TMPWorkerTree.h.

◆ fProcFunc

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

copy the function to be executed

Definition at line 99 of file TMPWorkerTree.h.

◆ fReducedResult

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

the results of the executions of fProcFunc merged together

Definition at line 100 of file TMPWorkerTree.h.

Libraries for TMPWorkerTreeFunc< F >:
[legend]

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