Provide multi-thread interface to manipulate with Job.
More...
#include "NAGASH/Analysis.h"
Provide multi-thread interface to manipulate with Job.
Definition at line 234 of file Analysis.h.
◆ Analysis() [1/5]
◆ Analysis() [2/5]
◆ Analysis() [3/5]
NAGASH::Analysis::Analysis |
( |
Analysis && |
ana | ) |
|
|
delete |
◆ Analysis() [4/5]
◆ Analysis() [5/5]
Analysis::Analysis |
( |
const char * |
configfilename | ) |
|
Constructor of the Analysis class.
- Parameters
-
configfilename | path to the configuration file. |
Definition at line 29 of file Analysis.cxx.
◆ ~Analysis()
◆ ConfigThreadPool()
void Analysis::ConfigThreadPool |
( |
| ) |
|
|
private |
◆ ConfigUser()
std::shared_ptr< ConfigTool > NAGASH::Analysis::ConfigUser |
( |
| ) |
|
|
inline |
◆ Join()
Join the threads in the thread pool.
Definition at line 97 of file Analysis.cxx.
◆ MSGUser()
std::shared_ptr< MSGTool > NAGASH::Analysis::MSGUser |
( |
| ) |
|
|
inline |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ ProcessEventLoop()
Process the user defined event loop. This function will automatically call Join() after submit the event loop.
- Template Parameters
-
LE | user-define event loop class, must inherit from LoopEvent. |
- Parameters
-
[in] | filelist | Input file list. |
[in] | dosave | Whether save the result, i.e. automatically call ResultGroup::Write() after finish the event loop. |
- Returns
- The ResultGroup of the event loop class defined by the user that stores the results after the entire event loop finished.
Definition at line 300 of file Analysis.h.
◆ ProcessEventLoopMainThread()
Single-thread mode of processing the user defined event loop. The event loop will be run in the main thread.
- Template Parameters
-
LE | user-define event loop class, must inherit from LoopEvent. |
- Parameters
-
[in] | filename | Input file name. |
[in] | dosave | Whether save the result, i.e. automatically call NAGASH::ResultGroup::Write() after finish the event loop. |
- Returns
- The ResultGroup of the event loop class defined by the user that stores the results after the entire event loop finished.
Definition at line 392 of file Analysis.h.
◆ SetThreadNumber()
void Analysis::SetThreadNumber |
( |
int |
num | ) |
|
Set the thread number of the thread pool. Can only be set once.
- Parameters
-
Definition at line 83 of file Analysis.cxx.
◆ SubmitEventLoop()
template<typename LE >
std::shared_ptr< ResultGroup > NAGASH::Analysis::SubmitEventLoop |
( |
const char * |
filelist, |
|
|
bool |
dosave = true |
|
) |
| |
Submit the user defined event loop. This function will not automatically call Join() after submit the event loop. So user can submit multiple event loops.
- Template Parameters
-
LE | user-define event loop class, must inherit from LoopEvent. |
- Parameters
-
[in] | filelist | Input file list. |
[in] | dosave | Whether save the result, i.e. automatically call ResultGroup::Write() after finish the event loop. |
- Returns
- The ResultGroup of the event loop class defined by the user that stores the results after the entire event loop finished.
Definition at line 316 of file Analysis.h.
◆ SubmitJob() [1/2]
Submit the user defined job. The Analysis will process the submitted jobs in multi-thread mode.
- Template Parameters
-
J | user-defined job class, must inherit from Job. |
...Args | types of other arguments to be passed to the job class. Can be automatically deduced by the compiler. |
- Parameters
-
doSave | Whether save the result, i.e. automatically call ResultGroup::Write() after finish the job. |
...args | other arguments to be passed to the job class, should be compatible with the definition of the Process function of the job class. |
- Returns
- The ResultGroup of the job class defined by the user that stores the results after the job finished.
Definition at line 416 of file Analysis.h.
◆ SubmitJob() [2/2]
Submit the user defined job. The Analysis will process the submitted jobs in multi-thread mode.
- Template Parameters
-
J | user-defined job class, must inherit from Job. |
JS | sometimes the Job::Process() function is a template function, this is the template type. |
...Args | types of other arguments to be passed to the job class. Can be automatically deduced by the compiler. |
- Parameters
-
doSave | Whether save the result, i.e. automatically call ResultGroup::Write() after finish the job. |
...args | other arguments to be passed to the job class, should be compatible with the definition of the Process function of the job class. |
- Returns
- The ResultGroup of the job class defined by the user that stores the results after the job finished.
Definition at line 455 of file Analysis.h.
◆ ThreadPoolEnqueue()
void NAGASH::Analysis::ThreadPoolEnqueue |
( |
F && |
f, |
|
|
Args &&... |
args |
|
) |
| |
|
private |
General function to enqueue a function into the thread pool inside Analysis class.
- Template Parameters
-
F | the type of the function to be enqueued. |
...Args | the type of the arguments of the function. |
- Parameters
-
f | the function to be enqueued. |
...args | the arguments of the function. |
Definition at line 488 of file Analysis.h.
◆ TimerUser()
std::shared_ptr< Timer > NAGASH::Analysis::TimerUser |
( |
| ) |
|
|
inlineprotected |
◆ config
std::shared_ptr<ConfigTool> NAGASH::Analysis::config |
|
protected |
◆ msg
std::shared_ptr<MSGTool> NAGASH::Analysis::msg |
|
private |
◆ pool
std::shared_ptr<ThreadPool> NAGASH::Analysis::pool |
|
private |
◆ ResultsToSave
std::vector<std::shared_ptr<ResultGroup> > NAGASH::Analysis::ResultsToSave |
|
protected |
◆ SubmittedJobCount
std::vector<int> NAGASH::Analysis::SubmittedJobCount |
|
private |
◆ SubmittedJobs
int NAGASH::Analysis::SubmittedJobs = 0 |
|
private |
◆ ThreadNumber
int NAGASH::Analysis::ThreadNumber = 1 |
|
private |
◆ timer
std::shared_ptr<Timer> NAGASH::Analysis::timer |
|
private |
◆ vf
std::vector<std::future<StatusCode> > NAGASH::Analysis::vf |
|
private |
The documentation for this class was generated from the following files: