Tomographer  v2.0
Tomographer C++ Framework Documentation
Tomographer::MultiProc::Sequential::TaskDispatcher< TaskType_, TaskCData_, ResultsCollector_, LoggerType_, CountIntType_ > Class Template Reference

Executes multiple tasks sequentially. More...

#include <tomographer2/multiproc.h>

Public Types

typedef TaskType_ TaskType
 
typedef TaskType::StatusReportType TaskStatusReportType
 
typedef TaskCData_ TaskCData
 
typedef ResultsCollector_ ResultsCollector
 
typedef LoggerType_ LoggerType
 
typedef CountIntType_ CountIntType
 
typedef TaskType::ResultType TaskResultType
 
typedef FullStatusReport< TaskStatusReportType > FullStatusReportType
 
typedef std::function< void(const FullStatusReportType &)> FullStatusReportCallbackType
 

Public Member Functions

 TaskDispatcher (TaskCData *pcdata_, ResultsCollector *results_, LoggerType &logger_, CountIntType num_total_runs_)
 
void run ()
 
template<typename Fn >
void setStatusReportHandler (Fn fnstatus)
 assign a callable to be called whenever a status report is requested More...
 
void requestStatusReport ()
 Request a status report. More...
 

Detailed Description

template<typename TaskType_, typename TaskCData_, typename ResultsCollector_, typename LoggerType_, typename CountIntType_ = int>
class Tomographer::MultiProc::Sequential::TaskDispatcher< TaskType_, TaskCData_, ResultsCollector_, LoggerType_, CountIntType_ >

Executes multiple tasks sequentially.

This task dispatcher is useful mainly for test cases, when testing tasks (and to see if a set of classes adhere well to the task manager/dispatcher type interfaces, see Task Manager/Dispatcher Interfaces).

Definition at line 147 of file multiproc.h.

Member Function Documentation

template<typename TaskType_ , typename TaskCData_ , typename ResultsCollector_ , typename LoggerType_ , typename CountIntType_ = int>
void Tomographer::MultiProc::Sequential::TaskDispatcher< TaskType_, TaskCData_, ResultsCollector_, LoggerType_, CountIntType_ >::requestStatusReport ( )
inline

Request a status report.

This function makes a note that a status report has been requested. Subsequently, the currently running task should notice it (provided it regularly queries for status report requests as described on the page Task Interface), and provides a status report. This status report, along with some additional information such as overall progress in number of task forms the full status report which is passed on to the callback set with setStatusReportHandler().

Note
This function is safe to be called from within a signal handler.

Definition at line 287 of file multiproc.h.

template<typename TaskType_ , typename TaskCData_ , typename ResultsCollector_ , typename LoggerType_ , typename CountIntType_ = int>
template<typename Fn >
void Tomographer::MultiProc::Sequential::TaskDispatcher< TaskType_, TaskCData_, ResultsCollector_, LoggerType_, CountIntType_ >::setStatusReportHandler ( Fn  fnstatus)
inline

assign a callable to be called whenever a status report is requested

This function remembers the given fnstatus callable, so that each time that requestStatusReport() is called at any later point, then this callback will be invoked.

The callback, when invoked, will be called with a single parameter of type FullStatusReport<TaskStatusReportType>.

Definition at line 271 of file multiproc.h.


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