ldas-tools-al  2.6.7
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
LDASTools::AL::Timer Class Reference

Give a task a maximum amount of time to complete. More...

#include <TaskTimer.hh>

Inheritance diagram for LDASTools::AL::Timer:
Inheritance graph
[legend]
Collaboration diagram for LDASTools::AL::Timer:
Collaboration graph
[legend]

Public Types

typedef boost::shared_ptr< char > name_type
 
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::cancel_type cancel_method
 
typedef Thread::signal_type signal_type
 Data class for passing signal information. More...
 
typedef Thread::signal_type signal_type
 Data class for passing signal information. More...
 
typedef Thread::signal_type signal_type
 Data class for passing signal information. More...
 

Public Member Functions

 Timer (int Seconds, signal_type CancelSignal=SignalHandler::SIGNAL_UNKNOWN)
 Constructor. More...
 
virtual void operator() ()
 Action. More...
 
bool Error () const
 True if time ran out for the process to complete. More...
 
 Timer (int Seconds, signal_type CancelSignal=SignalHandler::SIGNAL_UNKNOWN)
 Constructor. More...
 
virtual void operator() ()
 Action. More...
 
bool Error () const
 True if time ran out for the process to complete. More...
 
 Timer (int Seconds, signal_type CancelSignal=SignalHandler::SIGNAL_UNKNOWN)
 Constructor. More...
 
virtual void operator() ()
 Action. More...
 
bool Error () const
 True if time ran out for the process to complete. More...
 
MutexLock::baton_type Baton () const
 Retrieve baton to gain exclusive access. More...
 
MutexLock::baton_type Baton () const
 Retrieve baton to gain exclusive access. More...
 
MutexLock::baton_type Baton () const
 Retrieve baton to gain exclusive access. More...
 
cancel_method CancelMethod () const
 Retrieve method to use for terminating the task. More...
 
cancel_method CancelMethod () const
 Retrieve method to use for terminating the task. More...
 
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...
 
signal_type CancelSignal () const
 Retrieve signal 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...
 
bool DeleteOnCompletion () const
 Retrieve state information concearning deletion. More...
 
bool DeleteOnCompletion () const
 Retrieve state information concearning deletion. More...
 
virtual void OnCompletion (int TaskThreadState)
 Action to be done when task completes. More...
 
virtual void OnCompletion (int TaskThreadState)
 Action to be done when task completes. 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. More...
 
name_type TaskName () const
 Get the name of the current task. More...
 
name_type TaskName () const
 Get the name of the current task. More...
 

Protected Member Functions

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

Private Attributes

int m_timeout
 
bool m_err
 
name_type name
 
std::unique_ptr< _p_type_p
 

Detailed Description

Give a task a maximum amount of time to complete.

This class ensures that a task completes within a given amount of time. If the task does not complete, the it is canceled using the registered cancellation signal.

Member Typedef Documentation

◆ cancel_method [1/3]

◆ cancel_method [2/3]

◆ cancel_method [3/3]

◆ name_type [1/3]

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

◆ name_type [2/3]

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

◆ name_type [3/3]

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

◆ signal_type [1/3]

Data class for passing signal information.

◆ signal_type [2/3]

Data class for passing signal information.

◆ signal_type [3/3]

Data class for passing signal information.

Constructor & Destructor Documentation

◆ Timer() [1/3]

LDASTools::AL::Timer::Timer ( int  Seconds,
signal_type  CancelSignal = SignalHandler::SIGNAL_UNKNOWN 
)

Constructor.

Initialize the instance of the class.

Parameters
[in]SecondsNumber of seconds to allow task to complete
[in]CancelSignalSignal to use to cancel this timer.

◆ Timer() [2/3]

LDASTools::AL::Timer::Timer ( int  Seconds,
signal_type  CancelSignal = SignalHandler::SIGNAL_UNKNOWN 
)

Constructor.

Parameters
[in]SecondsNumber of seconds to allow task to complete
[in]CancelSignalSignal to use to cancel this timer.

◆ Timer() [3/3]

LDASTools::AL::Timer::Timer ( int  Seconds,
signal_type  CancelSignal = SignalHandler::SIGNAL_UNKNOWN 
)

Constructor.

Parameters
[in]SecondsNumber of seconds to allow task to complete
[in]CancelSignalSignal to use to cancel this timer.

Member Function Documentation

◆ Baton() [1/3]

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

Retrieve baton to gain exclusive access.

◆ Baton() [2/3]

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

Retrieve baton to gain exclusive access.

◆ Baton() [3/3]

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

Retrieve baton to gain exclusive access.

◆ CancelMethod() [1/3]

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

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
inherited

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
inherited

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
inherited

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
inherited

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
inherited

Retrieve signal to use for terminating the task.

Returns
The signal to be used to terminate the task.

◆ delete_on_completion() [1/3]

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

◆ delete_on_completion() [2/3]

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

◆ delete_on_completion() [3/3]

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

◆ DeleteOnCompletion() [1/3]

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

Retrieve state information concearning deletion.

Returns
True if the task should be deleted once terminated.

◆ DeleteOnCompletion() [2/3]

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

Retrieve state information concearning deletion.

Returns
True if the task should be deleted once terminated.

◆ DeleteOnCompletion() [3/3]

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

Retrieve state information concearning deletion.

Returns
True if the task should be deleted once terminated.

◆ Error() [1/3]

bool LDASTools::AL::Timer::Error ( ) const

True if time ran out for the process to complete.

Return true if the timer expired before being cancelled.

◆ Error() [2/3]

bool LDASTools::AL::Timer::Error ( ) const

True if time ran out for the process to complete.

◆ Error() [3/3]

bool LDASTools::AL::Timer::Error ( ) const

True if time ran out for the process to complete.

◆ OnCompletion() [1/3]

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

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

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

Action to be done when task completes.

◆ OnCompletion() [3/3]

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

Action to be done when task completes.

◆ operator()() [1/3]

void LDASTools::AL::Timer::operator() ( )
virtual

Action.

For the timer task, the action is to start an interuptable sleep timer for the requested maximum time period. m_err is set to true if the sleep timer completes without any error.

Implements LDASTools::AL::Task.

◆ operator()() [2/3]

virtual void LDASTools::AL::Timer::operator() ( )
virtual

Action.

Implements LDASTools::AL::Task.

◆ operator()() [3/3]

virtual void LDASTools::AL::Timer::operator() ( )
virtual

Action.

Implements LDASTools::AL::Task.

◆ TaskName() [1/3]

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

Get the name of the current task.

◆ TaskName() [2/3]

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

Get the name of the current task.

◆ TaskName() [3/3]

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

Get the name of the current task.

◆ taskName() [1/3]

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

◆ taskName() [2/3]

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

◆ taskName() [3/3]

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

Member Data Documentation

◆ _p

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

◆ m_err

bool LDASTools::AL::Timer::m_err
private

◆ m_timeout

int LDASTools::AL::Timer::m_timeout
private

◆ name

name_type LDASTools::AL::Task::name
privateinherited

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