Tomographer
v2.0
Tomographer C++ Framework Documentation
|
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... | |
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).
Task must be a Task Interface compliant type
TaskCData should conform to the TaskCData Interface.
ResultsCollector must be a ResultsCollector Interface compliant type
LoggerType is the type used for logging messages (derived from Logger::LoggerBase)
CountIntType should be a type to use to count the number of tasks. Usually there's no reason not to use an int
.
Definition at line 147 of file multiproc.h.
|
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().
Definition at line 287 of file multiproc.h.
|
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.