7#ifndef FMTTASKHANDLER_Hm_included
8#define FMTTASKHANDLER_Hm_included
37 unsigned int maxthread = 0);
50 unsigned int maxthread = 0);
74 const std::vector<std::unique_ptr<FMTTask>>&
getTasks()
const;
81 template<
class ptrtype>
84 std::vector<const ptrtype*>castedptr;
85 for (
const std::unique_ptr<FMTTask>& task : m_alltasks)
87 castedptr.push_back(
dynamic_cast<const ptrtype*
>(task.get()));
106 void passInLogger(
const std::unique_ptr<Logging::FMTLogger>& logger)
override;
110 unsigned int m_maxnumberofthread;
113 std::vector<std::unique_ptr<FMTTask>>m_alltasks;
124 void _finalize(std::unique_ptr<FMTTask>& lasttask);
130 void _logTaskTime(
const std::chrono::time_point<std::chrono::high_resolution_clock>& startime)
const;
136 static void _interruptWork(boost::thread& p_thread);
143 void _setMaximumNumberOfThreads(
const FMTTask& p_MainTask,
144 unsigned int p_UserDecision);
#define FMTEXPORT
Definition: FMTutility.h:125
Base class of multiple FMT classes holding a shared exception handler pointer and logger.
Definition: FMTObject.h:49
Main class for running concurrent tasks at the same time.
Definition: FMTTaskHandler.h:27
~FMTTaskHandler()=default
Default destructor for FMTTaskHandler.
void conccurentRun()
Use the split task virtual function to generate all the tasks and run them at the same time.
void passInLogger(const std::unique_ptr< Logging::FMTLogger > &logger) override
Pass in the logger, overridden for the OsiSolverInterface.
FMTTaskHandler(const std::unique_ptr< FMTTask > &maintask, unsigned int maxthread=0)
Construct the handler from a main task and a number of threads.
FMTTaskHandler(const FMTTask &maintask, unsigned int maxthread=0)
Constructor for Python and R taking a FMTTask by reference.
const std::vector< const ptrtype * > getTasksFromDynamicCast() const
Return the tasks dynamically cast to the requested pointer type.
Definition: FMTTaskHandler.h:82
FMTTaskHandler(const FMTTaskHandler &rhs)
Default copy constructor for FMTTaskHandler.
const std::vector< std::unique_ptr< FMTTask > > & getTasks() const
Return a reference to the tasks handled by the task handler.
void onDemandRun()
Use the spawn task virtual function to generate tasks from the master task and add them to a list,...
FMTTaskHandler()=default
Default constructor for FMTTaskHandler.
Task for parallel jobs.
Definition: FMTTask.h:27
Namespace for parallel tasking may include multithreading / multiprocessing.
Definition: FMTOpAreaSchedulerTask.h:40
Definition: FMTAction.h:463