14#include <boost/function.hpp>
63 FunctionTask(std::function<
void()> func,
double cost = 1.0) :
Task(cost), m_voidFunc(
std::move(func)) {}
71 throw std::runtime_error(
"FunctionTask: NULL method pointer provided.");
#define DLLExport
Definitions of the DLLImport compiler directives for MSVC.
A FunctionTask can easily create a Task from a method pointer.
void(*)() voidFunction
Typedef for a function with no arguments and no return.
FunctionTask(std::function< void()> func, double cost=1.0)
Constructor for a simple boost bound function.
FunctionTask(voidFunction func, double cost=1.0)
Constructor for a simple void function.
void run() override
Main method that performs the work for the task.
std::function< void()> m_voidFunc
A Task is a unit of work to be scheduled and run by a ThreadPool.
Helper class which provides the Collimation Length for SANS instruments.