Logo ROOT   6.08/07
Reference Guide
List of all members | Public Member Functions | Private Attributes | List of all members
TPoolWorker< F, T, void > Class Template Reference

template<class F, class T>
class TPoolWorker< F, T, void >

Definition at line 168 of file TPoolWorker.h.

Public Member Functions

 TPoolWorker (F func, const std::vector< T > &args)
 
 ~TPoolWorker ()
 
void HandleInput (MPCodeBufPair &msg)
 Handle a message with an EMPCode. 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 ()
 
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 Attributes

std::vector< T > fArgs
 a vector containing the arguments that must be passed to fFunc More...
 
F fFunc
 the function to be executed 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 <TPoolWorker.h>

Inheritance diagram for TPoolWorker< F, T, void >:
[legend]

Constructor & Destructor Documentation

◆ TPoolWorker()

template<class F , class T >
TPoolWorker< F, T, void >::TPoolWorker ( F  func,
const std::vector< T > &  args 
)
inline

Definition at line 170 of file TPoolWorker.h.

◆ ~TPoolWorker()

template<class F , class T >
TPoolWorker< F, T, void >::~TPoolWorker ( )
inline

Definition at line 171 of file TPoolWorker.h.

Member Function Documentation

◆ HandleInput()

template<class F , class T >
void TPoolWorker< F, T, void >::HandleInput ( MPCodeBufPair msg)
inlinevirtual

Handle a message with an EMPCode.

This method is called upon receiving a message with a code >= 1000 (i.e. EMPCode). It handles the most generic types of messages.
Classes inheriting from TMPWorker should implement their own HandleInput function, that should be able to handle codes specific to that application.
The appropriate version of the HandleInput method (TMPWorker's or the overriding version) is automatically called depending on the message code.

Parameters
msgExecute instructions received from a TProcessExecutor client

Reimplemented from TMPWorker.

Definition at line 172 of file TPoolWorker.h.

Member Data Documentation

◆ fArgs

template<class F , class T >
std::vector<T> TPoolWorker< F, T, void >::fArgs
private

a vector containing the arguments that must be passed to fFunc

Definition at line 189 of file TPoolWorker.h.

◆ fFunc

template<class F , class T >
F TPoolWorker< F, T, void >::fFunc
private

the function to be executed

Definition at line 188 of file TPoolWorker.h.


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