ldas-tools-al
2.6.3
|
Give a task a maximum amount of time to complete. More...
#include <TaskTimer.hh>
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 | |
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. | |
bool | Error () const |
True if time ran out for the process to complete. | |
Timer (int Seconds, signal_type CancelSignal=SignalHandler::SIGNAL_UNKNOWN) | |
Constructor. More... | |
virtual void | operator() () |
Action. | |
bool | Error () const |
True if time ran out for the process to complete. | |
MutexLock::baton_type | Baton () const |
Retrieve baton to gain exclusive access. | |
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. 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. | |
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. | |
name_type | TaskName () const |
Get the name of the current task. | |
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.
LDASTools::AL::Timer::Timer | ( | int | Seconds, |
signal_type | CancelSignal = SignalHandler::SIGNAL_UNKNOWN |
||
) |
Constructor.
Initialize the instance of the class.
[in] | Seconds | Number of seconds to allow task to complete |
[in] | CancelSignal | Signal to use to cancel this timer. |
LDASTools::AL::Timer::Timer | ( | int | Seconds, |
signal_type | CancelSignal = SignalHandler::SIGNAL_UNKNOWN |
||
) |
Constructor.
[in] | Seconds | Number of seconds to allow task to complete |
[in] | CancelSignal | Signal to use to cancel this timer. |
LDASTools::AL::Timer::Timer | ( | int | Seconds, |
signal_type | CancelSignal = SignalHandler::SIGNAL_UNKNOWN |
||
) |
Constructor.
[in] | Seconds | Number of seconds to allow task to complete |
[in] | CancelSignal | Signal to use to cancel this timer. |
|
inherited |
Retrieve method to use for terminating the task.
|
inherited |
Retrieve method to use for terminating the task.
|
inherited |
Retrieve method to use for terminating the task.
|
inherited |
Retrieve signal to use for terminating the task.
|
inherited |
Retrieve signal to use for terminating the task.
|
inherited |
Retrieve signal to use for terminating the task.
|
inherited |
Retrieve state information concearning deletion.
|
inherited |
Retrieve state information concearning deletion.
|
inherited |
Retrieve state information concearning deletion.
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.
|
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.
|
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.