ldas-tools-al 2.6.7
Public Types | Public Member Functions | List of all members
LDASTools::AL::Task Class Referenceabstract

A unit of work to be done usually within a thread. More...

#include <Task.hh>

Inheritance diagram for LDASTools::AL::Task:
Inheritance graph
[legend]

Public Types

typedef Thread::signal_type signal_type
 Data class for passing signal information.
 
typedef Thread::signal_type signal_type
 Data class for passing signal information.
 
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.
 
 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.
 
name_type TaskName () const
 Get the name of the current task.
 
virtual void operator() ()=0
 Action to perform.
 
 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.
 
name_type TaskName () const
 Get the name of the current task.
 
virtual void operator() ()=0
 Action to perform.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Task() [1/3]

LDASTools::AL::Task::Task ( const std::string &  Name,
cancel_method  CancelMethod = Thread::CANCEL_ABANDON,
signal_type  CancelSignal = SignalHandler::SIGNAL_UNKNOWN 
)

Constructor.

Parameters
[in]NameSudo unique name identifying the task
[in]CancelMethodMethod to use when terminating the task
[in]CancelSignalSignal to use for termination of the task

◆ Task() [2/3]

LDASTools::AL::Task::Task ( const std::string &  Name,
cancel_method  CancelMethod = Thread::CANCEL_ABANDON,
signal_type  CancelSignal = SignalHandler::SIGNAL_UNKNOWN 
)

Constructor.

Parameters
[in]NameSudo unique name identifying the task
[in]CancelMethodMethod to use when terminating the task
[in]CancelSignalSignal to use for termination of the task

◆ Task() [3/3]

LDASTools::AL::Task::Task ( const std::string &  Name,
cancel_method  CancelMethod = Thread::CANCEL_ABANDON,
signal_type  CancelSignal = SignalHandler::SIGNAL_UNKNOWN 
)

Constructor.

Parameters
[in]NameSudo unique name identifying the task
[in]CancelMethodMethod to use when terminating the task
[in]CancelSignalSignal to use for termination of the task

Member Function Documentation

◆ CancelMethod() [1/3]

Task::cancel_method LDASTools::AL::Task::CancelMethod ( ) const

Retrieve method to use for terminating the task.

Returns
The method to be used to terminate the task.

◆ CancelMethod() [2/3]

cancel_method LDASTools::AL::Task::CancelMethod ( ) const

Retrieve method to use for terminating the task.

Returns
The method to be used to terminate the task.

◆ CancelMethod() [3/3]

cancel_method LDASTools::AL::Task::CancelMethod ( ) const

Retrieve method to use for terminating the task.

Returns
The method to be used to terminate the task.

◆ CancelSignal() [1/3]

Task::signal_type LDASTools::AL::Task::CancelSignal ( ) const

Retrieve signal to use for terminating the task.

Returns
The signal to be used to terminate the task.

◆ CancelSignal() [2/3]

signal_type LDASTools::AL::Task::CancelSignal ( ) const

Retrieve signal to use for terminating the task.

Returns
The signal to be used to terminate the task.

◆ CancelSignal() [3/3]

signal_type LDASTools::AL::Task::CancelSignal ( ) const

Retrieve signal to use for terminating the task.

Returns
The signal to be used to terminate the task.

◆ DeleteOnCompletion() [1/3]

bool LDASTools::AL::Task::DeleteOnCompletion ( ) const

Retrieve state information concearning deletion.

Returns
True if the task should be deleted once terminated.

◆ DeleteOnCompletion() [2/3]

bool LDASTools::AL::Task::DeleteOnCompletion ( ) const

Retrieve state information concearning deletion.

Returns
True if the task should be deleted once terminated.

◆ DeleteOnCompletion() [3/3]

bool LDASTools::AL::Task::DeleteOnCompletion ( ) const

Retrieve state information concearning deletion.

Returns
True if the task should be deleted once terminated.

◆ OnCompletion()

void LDASTools::AL::Task::OnCompletion ( int  TaskThreadState)
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.


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