Mantid
|
A Task is a unit of work to be scheduled and run by a ThreadPool. More...
#include <Task.h>
Public Member Functions | |
virtual double | cost () |
What is the computational cost of this task? More... | |
std::shared_ptr< std::mutex > | getMutex () |
Get the mutex object for this Task. More... | |
virtual void | run ()=0 |
Main method that performs the work for the task. More... | |
void | setMutex (const std::shared_ptr< std::mutex > &mutex) |
Set the mutex object for this Task. More... | |
void | setMutexObject (void *object) |
Use an arbitrary pointer to lock (mutex) the execution of this task. More... | |
Task () | |
Default constructor. More... | |
Task (double cost) | |
Constructor with cost. More... | |
virtual | ~Task ()=default |
Destructor. More... | |
Protected Attributes | |
double | m_cost |
Cached computational cost for the thread. More... | |
std::shared_ptr< std::mutex > | m_mutex |
Mutex associated with this task (can be NULL) More... | |
A Task is a unit of work to be scheduled and run by a ThreadPool.
This class is abstract and will be overridden. Its main method is the run() method, which does the work.
|
inline |
|
virtualdefault |
Destructor.
|
inlinevirtual |
What is the computational cost of this task?
Definition at line 53 of file Task.h.
Referenced by Mantid::Kernel::compareTasks().
|
inline |
Get the mutex object for this Task.
Definition at line 72 of file Task.h.
Referenced by Mantid::Kernel::ThreadSchedulerMutexes::finished().
|
pure virtual |
Main method that performs the work for the task.
Implemented in Mantid::DataHandling::LoadBankFromDiskTask, Mantid::DataHandling::ProcessBankData, and Mantid::Kernel::FunctionTask.
|
inline |
Set the mutex object for this Task.
mutex | :: Mutex pointer, or NULL |
Definition at line 78 of file Task.h.
Referenced by Mantid::DataHandling::LoadBankFromDiskTask::LoadBankFromDiskTask().
|
inline |
Use an arbitrary pointer to lock (mutex) the execution of this task.
For example, you might point to a particular EventList in memory to signify that this task will operate on this object.
object | :: any pointer. |
Definition at line 63 of file Task.h.
References UNUSED_ARG.
|
protected |
Cached computational cost for the thread.
Definition at line 82 of file Task.h.
Referenced by Mantid::DataHandling::LoadBankFromDiskTask::LoadBankFromDiskTask(), and Mantid::DataHandling::ProcessBankData::ProcessBankData().
|
protected |