Logo ROOT   6.08/07
Reference Guide
List of all members | Public Member Functions | Private Member Functions | Private Attributes | List of all members
TPoolPlayer Class Reference

Definition at line 20 of file TPoolPlayer.h.

Public Member Functions

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

Private Member Functions

void ProcDataSet (unsigned int code, MPCodeBufPair &msg)
 Run fSelector->Process over a data set. More...
 
void ProcTree (MPCodeBufPair &msg)
 Run fSelector->Process over the tree entries, send back result. More...
 

Private Attributes

std::vector< std::string > fFileNames
 the files to be processed by all workers More...
 
bool fFirstEntry = true
 
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...
 
TSelectorfSelector
 pointer to the selector to be used to process the tree. It is null if we are not using a TSelector. More...
 
TTreefTree
 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...
 

Additional Inherited Members

- Protected Member Functions inherited from TMPWorker
void CloseFile ()
 Handle file closing. More...
 
TFileOpenFile (const std::string &fileName)
 Handle file opening. More...
 
TTreeRetrieveTree (TFile *fp)
 Retrieve a tree from an open file. More...
 
void SendError (const std::string &errmsg, unsigned int code=MPCode::kError)
 Error sender. More...
 
void Setup ()
 Auxilliary method for common initializations. More...
 
void SetupTreeCache (TTree *tree)
 Tree cache handling. More...
 
- Protected Attributes inherited from TMPWorker
TFilefFile
 last open file More...
 
std::vector< std::string > fFileNames
 the files to be processed by all workers More...
 
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...
 
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...
 

#include <TPoolPlayer.h>

Inheritance diagram for TPoolPlayer:
[legend]

Constructor & Destructor Documentation

◆ TPoolPlayer() [1/2]

TPoolPlayer::TPoolPlayer ( TSelector selector,
TTree tree,
unsigned  nWorkers,
ULong64_t  maxEntries 
)
inline

Definition at line 22 of file TPoolPlayer.h.

◆ TPoolPlayer() [2/2]

TPoolPlayer::TPoolPlayer ( TSelector selector,
const std::vector< std::string > &  fileNames,
const std::string &  treeName,
unsigned  nWorkers,
ULong64_t  maxEntries 
)
inline

Definition at line 27 of file TPoolPlayer.h.

◆ ~TPoolPlayer()

TPoolPlayer::~TPoolPlayer ( )
inline

Definition at line 34 of file TPoolPlayer.h.

Member Function Documentation

◆ HandleInput()

void TPoolPlayer::HandleInput ( MPCodeBufPair msg)
virtual

Execute instructions received from a TPool client.

Reimplemented from TMPWorker.

Definition at line 13 of file TPoolPlayer.cxx.

◆ Init()

void TPoolPlayer::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 9 of file TPoolPlayer.cxx.

◆ ProcDataSet()

void TPoolPlayer::ProcDataSet ( unsigned int  code,
MPCodeBufPair msg 
)
private

Run fSelector->Process over a data set.

Definition at line 31 of file TPoolPlayer.cxx.

◆ ProcTree()

void TPoolPlayer::ProcTree ( MPCodeBufPair msg)
private

Run fSelector->Process over the tree entries, send back result.

Definition at line 116 of file TPoolPlayer.cxx.

Member Data Documentation

◆ fFileNames

std::vector<std::string> TPoolPlayer::fFileNames
private

the files to be processed by all workers

Definition at line 44 of file TPoolPlayer.h.

◆ fFirstEntry

bool TPoolPlayer::fFirstEntry = true
private

Definition at line 50 of file TPoolPlayer.h.

◆ fMaxNEntries

ULong64_t TPoolPlayer::fMaxNEntries
private

the maximum number of entries to be processed by this worker

Definition at line 48 of file TPoolPlayer.h.

◆ fNWorkers

unsigned TPoolPlayer::fNWorkers
private

the number of workers spawned

Definition at line 47 of file TPoolPlayer.h.

◆ fProcessedEntries

ULong64_t TPoolPlayer::fProcessedEntries
private

the number of entries processed by this worker so far

Definition at line 49 of file TPoolPlayer.h.

◆ fSelector

TSelector& TPoolPlayer::fSelector
private

pointer to the selector to be used to process the tree. It is null if we are not using a TSelector.

Definition at line 43 of file TPoolPlayer.h.

◆ fTree

TTree* TPoolPlayer::fTree
private

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

Definition at line 46 of file TPoolPlayer.h.

◆ fTreeName

std::string TPoolPlayer::fTreeName
private

the name of the tree to be processed

Definition at line 45 of file TPoolPlayer.h.


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