FMT 0.9.8
Forest management tools for forest planning
|
#include <FMTtask.hpp>
Public Member Functions | |
FMTtask () | |
virtual | ~FMTtask ()=default |
FMTtask (const FMTtask &rhs) | |
FMTtask & | operator= (const FMTtask &rhs) |
virtual std::unique_ptr< FMTtask > | clone () const |
virtual std::vector< std::unique_ptr< FMTtask > > | split (const unsigned int &numberoftasks) const |
virtual std::unique_ptr< FMTtask > | spawn () |
virtual void | work () |
virtual void | finalize () |
bool | isdone () const |
std::string | getthreadid () const |
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) |
Protected Member Functions | |
void | setstatus (bool status) |
std::vector< size_t > | splitwork (int numberoftasks, const int &totalworksize) const |
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 () |
Protected Attributes | |
std::unique_ptr< Logging::FMTlogger > | tasklogger |
Static Protected Attributes | |
static boost::recursive_mutex | taskmutex |
Recursive mutex for the task. | |
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. | |
Additional Inherited Members | |
Static Public Member Functions inherited from Core::FMTobject | |
static std::string | getruntimelocation () |
static unsigned long long | getavailablememory () |
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) |
Task for parallel jobs needs to implement a clone / work / split functions for your task to used it in the taskhandler.
Parallel::FMTtask::FMTtask | ( | ) |
Default constructor for FMTtask
|
virtualdefault |
FMTtask default virutal destructor.
|
virtual |
Clone function for FMTtask.
Reimplemented in Parallel::FMTopareaschedulertask, Parallel::FMTplanningtask, and Parallel::FMTreplanningtask.
|
virtual |
If this function is overrided it will be called right after the last task is done
Reimplemented in Parallel::FMTopareaschedulertask, Parallel::FMTplanningtask, and Parallel::FMTreplanningtask.
std::string Parallel::FMTtask::getthreadid | ( | ) | const |
Get the thread id of the task.
bool Parallel::FMTtask::isdone | ( | ) | const |
Returns true if the job is all done.
|
protected |
Change the status of the task
|
virtual |
Will spawn a minimal task from the master task
Reimplemented in Parallel::FMTopareaschedulertask, Parallel::FMTplanningtask, and Parallel::FMTreplanningtask.
|
virtual |
Function to split the actual task in multiple tasks.
Reimplemented in Parallel::FMTopareaschedulertask, Parallel::FMTplanningtask, and Parallel::FMTreplanningtask.
|
protected |
Split the totalworksize in much possible equal buckets.
|
virtual |
This function is the main job executed by the thread.
Reimplemented in Parallel::FMTopareaschedulertask, Parallel::FMTplanningtask, and Parallel::FMTreplanningtask.
|
protected |
Logger for solver in parallel...coinmessagehandler does not support concurency. This logger wont print anything so dont use it in parallel.
|
staticprotected |
Recursive mutex for the task.