ldas-tools-al 2.6.7
 
Loading...
Searching...
No Matches
Task Class Referenceabstract

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

#include <Task.hh>

Inheritance diagram for Task:

Classes

struct  _p_type
 

Public Types

typedef boost::shared_ptr< char > name_type
 
typedef boost::shared_ptr< char > name_type
 
typedef Thread::cancel_type cancel_method
 
typedef Thread::cancel_type cancel_method
 
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.
 
 Task (const std::string &Name, cancel_method CancelMethod=Thread::CANCEL_ABANDON, signal_type CancelSignal=SignalHandler::SIGNAL_UNKNOWN)
 Constructor.
 
virtual ~Task ()
 Destructor.
 
virtual ~Task ()
 Destructor.
 
MutexLock::baton_type Baton () const
 Retrieve baton to gain exclusive access.
 
MutexLock::baton_type Baton () const
 Retrieve baton to gain exclusive access.
 
cancel_method CancelMethod () const
 Retrieve method to use for terminating the task.
 
cancel_method CancelMethod () const
 Retrieve method to use for terminating the task.
 
signal_type CancelSignal () const
 Retrieve signal to use for terminating the task.
 
signal_type CancelSignal () const
 Retrieve signal to use for terminating the task.
 
bool DeleteOnCompletion () const
 Retrieve state information concearning deletion.
 
bool DeleteOnCompletion () const
 Retrieve state information concearning deletion.
 
virtual void OnCompletion (int TaskThreadState)
 Action to be done when task completes.
 
virtual void OnCompletion (int TaskThreadState)
 Action to be done when task completes.
 
name_type TaskName () const
 Get the name of the current task.
 
name_type TaskName () const
 Get the name of the current task.
 
virtual void operator() ()=0
 Action to perform.
 
virtual void operator() ()=0
 Action to perform.
 

Protected Member Functions

void taskName (const std::string &Name)
 
void taskName (const std::string &Name)
 
void delete_on_completion (bool Value)
 
void delete_on_completion (bool Value)
 

Private Attributes

name_type name
 
std::unique_ptr< _p_type_p
 

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.

Member Typedef Documentation

◆ cancel_method [1/2]

◆ cancel_method [2/2]

◆ name_type [1/2]

typedef boost::shared_ptr< char > LDASTools::AL::Task::name_type

◆ name_type [2/2]

typedef boost::shared_ptr< char > LDASTools::AL::Task::name_type

◆ signal_type [1/2]

Data class for passing signal information.

◆ signal_type [2/2]

Data class for passing signal information.

Constructor & Destructor Documentation

◆ Task() [1/2]

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/2]

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() [1/2]

LDASTools::AL::Task::~Task ( )
virtual

Destructor.

◆ ~Task() [2/2]

virtual LDASTools::AL::Task::~Task ( )
virtual

Destructor.

Member Function Documentation

◆ Baton() [1/2]

MutexLock::baton_type LDASTools::AL::Task::Baton ( ) const

Retrieve baton to gain exclusive access.

◆ Baton() [2/2]

MutexLock::baton_type LDASTools::AL::Task::Baton ( ) const

Retrieve baton to gain exclusive access.

◆ CancelMethod() [1/2]

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/2]

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/2]

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/2]

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.

◆ delete_on_completion() [1/2]

void LDASTools::AL::Task::delete_on_completion ( bool Value)
protected

◆ delete_on_completion() [2/2]

void LDASTools::AL::Task::delete_on_completion ( bool Value)
protected

◆ DeleteOnCompletion() [1/2]

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

Retrieve state information concearning deletion.

Returns
True if the task should be deleted once terminated.

◆ DeleteOnCompletion() [2/2]

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

Retrieve state information concearning deletion.

Returns
True if the task should be deleted once terminated.

◆ OnCompletion() [1/2]

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.

◆ OnCompletion() [2/2]

virtual void LDASTools::AL::Task::OnCompletion ( int TaskThreadState)
virtual

Action to be done when task completes.

◆ operator()() [1/2]

virtual void LDASTools::AL::Task::operator() ( )
pure virtual

Action to perform.

◆ operator()() [2/2]

virtual void LDASTools::AL::Task::operator() ( )
pure virtual

Action to perform.

◆ TaskName() [1/2]

Task::name_type LDASTools::AL::Task::TaskName ( ) const
inline

Get the name of the current task.

◆ TaskName() [2/2]

name_type LDASTools::AL::Task::TaskName ( ) const

Get the name of the current task.

◆ taskName() [1/2]

void LDASTools::AL::Task::taskName ( const std::string & Name)
inlineprotected

◆ taskName() [2/2]

void LDASTools::AL::Task::taskName ( const std::string & Name)
protected

Member Data Documentation

◆ _p

std::unique_ptr< _p_type > LDASTools::AL::Task::_p
private

◆ name

name_type LDASTools::AL::Task::name
private

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