FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Parallel::FMTtaskhandler Class Reference

#include <FMTtaskhandler.hpp>

Inheritance diagram for Parallel::FMTtaskhandler:
[legend]
Collaboration diagram for Parallel::FMTtaskhandler:
[legend]

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)
 
FMTtaskhandleroperator= (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)
 
FMTobjectoperator= (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.
 

Detailed Description

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

Constructor & Destructor Documentation

◆ FMTtaskhandler() [1/4]

Parallel::FMTtaskhandler::FMTtaskhandler ( const std::unique_ptr< FMTtask > &  maintask,
unsigned int  maxthread = 0 
)

Construct the handler with the number of threads you want.

◆ ~FMTtaskhandler()

Parallel::FMTtaskhandler::~FMTtaskhandler ( )
default

Default destructor for FMTtaskhandler.

◆ FMTtaskhandler() [2/4]

Parallel::FMTtaskhandler::FMTtaskhandler ( const FMTtask maintask,
unsigned int  maxthread = 0 
)

Abstract constructor for Python and R...you need to pass a FMTtask to this constructor.

◆ FMTtaskhandler() [3/4]

Parallel::FMTtaskhandler::FMTtaskhandler ( )
default

Default constructor for FMTtaskhandler

◆ FMTtaskhandler() [4/4]

Parallel::FMTtaskhandler::FMTtaskhandler ( const FMTtaskhandler rhs)

Default copy constructor for FMTtaskhandler

Member Function Documentation

◆ conccurentrun()

void Parallel::FMTtaskhandler::conccurentrun ( )

Will use the split task virtual function to generate all the tasks at the same time.

◆ gettasks()

const std::vector< std::unique_ptr< FMTtask > > & Parallel::FMTtaskhandler::gettasks ( ) const

Return reference to the task handled by the task handler.

◆ gettasksfromdynamiccast()

template<class ptrtype >
const std::vector< const ptrtype * > Parallel::FMTtaskhandler::gettasksfromdynamiccast ( ) const
inline

Return reference to the task already in the ptrype.

◆ ondemandrun()

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.

◆ operator=()

FMTtaskhandler & Parallel::FMTtaskhandler::operator= ( const FMTtaskhandler rhs)

Default copy assignement for FMTtaskhandler

◆ passinlogger()

void Parallel::FMTtaskhandler::passinlogger ( const std::shared_ptr< Logging::FMTlogger > &  logger)
overridevirtual

We need to override the passinlogger for the osisolverinterface

Reimplemented from Core::FMTobject.


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