ldas-tools-al
2.6.2
|
A unit of work to be done usually within a thread. More...
#include <Task.hh>
Public Types | |
typedef Thread::signal_type | signal_type |
Data class for passing signal information. | |
Public Member Functions | |
Task (const std::string &Name, cancel_method CancelMethod=Thread::CANCEL_ABANDON, signal_type CancelSignal=SignalHandler::SIGNAL_UNKNOWN) | |
Constructor. More... | |
virtual | ~Task () |
Destructor. | |
MutexLock::baton_type | Baton () const |
Retrieve baton to gain exclusive access. | |
cancel_method | CancelMethod () const |
Retrieve method to use for terminating the task. More... | |
signal_type | CancelSignal () const |
Retrieve signal to use for terminating the task. More... | |
bool | DeleteOnCompletion () const |
Retrieve state information concearning deletion. More... | |
virtual void | OnCompletion (int TaskThreadState) |
Action to be done when task completes. More... | |
name_type | TaskName () const |
Get the name of the current task. | |
virtual void | operator() ()=0 |
Action to perform. | |
A unit of work to be done usually within a thread.
This is an abstract class that should be used as the base for a class that is to perform some task usually within a thread.
LDASTools::AL::Task::Task | ( | const std::string & | Name, |
cancel_method | CancelMethod = Thread::CANCEL_ABANDON , |
||
signal_type | CancelSignal = SignalHandler::SIGNAL_UNKNOWN |
||
) |
Constructor.
[in] | Name | Sudo unique name identifying the task |
[in] | CancelMethod | Method to use when terminating the task |
[in] | CancelSignal | Signal to use for termination of the task |
Task::cancel_method LDASTools::AL::Task::CancelMethod | ( | ) | const |
Retrieve method to use for terminating the task.
Task::signal_type LDASTools::AL::Task::CancelSignal | ( | ) | const |
Retrieve signal to use for terminating the task.
bool LDASTools::AL::Task::DeleteOnCompletion | ( | ) | const |
Retrieve state information concearning deletion.
|
virtual |
Action to be done when task completes.
This function is called regardless of why the task was terminated. It allows for any special cleanup or other action that needs to happen at the end of a task regardless of why the task terminated.