FMT 0.9.8
Forest management tools for forest planning
|
#include <FMTtaskhandler.hpp>
Public Member Functions | |
FMTtaskhandler (const std::unique_ptr< FMTtask > &maintask, unsigned int maxthread=0) | |
~FMTtaskhandler ()=default | |
FMTtaskhandler (const FMTtask &maintask, unsigned int maxthread=0) | |
FMTtaskhandler ()=default | |
FMTtaskhandler (const FMTtaskhandler &rhs) | |
FMTtaskhandler & | operator= (const FMTtaskhandler &rhs) |
const std::vector< std::unique_ptr< FMTtask > > & | gettasks () const |
template<class ptrtype > | |
const std::vector< const ptrtype * > | gettasksfromdynamiccast () const |
void | conccurentrun () |
void | ondemandrun () |
void | passinlogger (const std::shared_ptr< Logging::FMTlogger > &logger) override |
Public Member Functions inherited from Core::FMTobject | |
FMTobject () | |
virtual | ~FMTobject () |
FMTobject (const std::shared_ptr< Exception::FMTexceptionhandler > exhandler) | |
FMTobject (const FMTobject &rhs) | |
FMTobject & | operator= (const FMTobject &rhs) |
virtual void | passinlogger (const std::shared_ptr< Logging::FMTlogger > &logger) |
void | passinexceptionhandler (const std::shared_ptr< Exception::FMTexceptionhandler > &exhandler) |
void | redirectlogtofile (const std::string &location) |
virtual void | setdefaultlogger () |
virtual void | setquietlogger () |
virtual void | settasklogger () |
virtual void | setdebuglogger () |
void | setdefaultexceptionhandler () |
void | setquietexceptionhandler () |
void | setdebugexceptionhandler () |
void | setfreeexceptionhandler () |
void | disablenestedexceptions () |
void | enablenestedexceptions () |
void | seterrorstowarnings (const std::vector< Exception::FMTexc > &errors) |
void | setmaxwarningsbeforesilenced (const size_t &maxwarningcount) |
Additional Inherited Members | |
Static Public Member Functions inherited from Core::FMTobject | |
static std::string | getruntimelocation () |
static unsigned long long | getavailablememory () |
Protected Member Functions inherited from Core::FMTobject | |
template<class Archive > | |
void | forcesave (Archive &ar, const unsigned int version) const |
template<class Archive > | |
void | forceload (Archive &ar, const unsigned int version) |
void | checksignals () const |
void | setCPLhandler () |
Static Protected Member Functions inherited from Core::FMTobject | |
static std::chrono::time_point< std::chrono::high_resolution_clock > | getclock () |
template<class chrono > | |
static double | getduration (const std::chrono::time_point< std::chrono::high_resolution_clock > &startclock) |
static std::string | getdurationinseconds (const std::chrono::time_point< std::chrono::high_resolution_clock > &startclock) |
Static Protected Attributes inherited from Core::FMTobject | |
static std::shared_ptr< Exception::FMTexceptionhandler > | _exhandler |
A shared pointer to the exception handler. | |
static std::shared_ptr< Logging::FMTlogger > | _logger |
A shared pointer to the logger. | |
Main class for running concurrent tasks at the same time. It uses the virtual function split() from FMTtask to split the task in multiple task and can run it concurrently
Parallel::FMTtaskhandler::FMTtaskhandler | ( | const std::unique_ptr< FMTtask > & | maintask, |
unsigned int | maxthread = 0 |
||
) |
Construct the handler with the number of threads you want.
|
default |
Default destructor for FMTtaskhandler.
Parallel::FMTtaskhandler::FMTtaskhandler | ( | const FMTtask & | maintask, |
unsigned int | maxthread = 0 |
||
) |
|
default |
Default constructor for FMTtaskhandler
Parallel::FMTtaskhandler::FMTtaskhandler | ( | const FMTtaskhandler & | rhs | ) |
Default copy constructor for FMTtaskhandler
void Parallel::FMTtaskhandler::conccurentrun | ( | ) |
Will use the split task virtual function to generate all the tasks at the same time.
const std::vector< std::unique_ptr< FMTtask > > & Parallel::FMTtaskhandler::gettasks | ( | ) | const |
Return reference to the task handled by the task handler.
|
inline |
Return reference to the task already in the ptrype.
void Parallel::FMTtaskhandler::ondemandrun | ( | ) |
Will use the spawn task virtual function to generate task from the master task and add to a list If the task is completed it will be removed from the list.
FMTtaskhandler & Parallel::FMTtaskhandler::operator= | ( | const FMTtaskhandler & | rhs | ) |
Default copy assignement for FMTtaskhandler
|
overridevirtual |
We need to override the passinlogger for the osisolverinterface
Reimplemented from Core::FMTobject.