ldas-tools-al 2.6.7
 
Loading...
Searching...
No Matches
LDASTools::AL::SystemCallTask Class Referenceabstract

Perform a system call within a thread. More...

#include <SystemCallTask.hh>

Inheritance diagram for LDASTools::AL::SystemCallTask:
Collaboration diagram for LDASTools::AL::SystemCallTask:

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

 SystemCallTask ()
 Constructor.
 
 SystemCallTask ()
 Constructor.
 
int SystemErrNo () const
 Return the thread specific value of errno.
 
int SystemErrNo () const
 Return the thread specific value of errno.
 
int SystemReturnCode () const
 Return the return code of the system call.
 
int SystemReturnCode () const
 Return the return code of the system call.
 
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.
 

Protected Member Functions

virtual int eval ()=0
 Action to be performed.
 
virtual int eval ()=0
 Action to be performed.
 
void taskName (const std::string &Name)
 
void taskName (const std::string &Name)
 
void delete_on_completion (bool Value)
 
void delete_on_completion (bool Value)
 

Protected Attributes

int m_returnCode
 Return code of the system call.
 
int m_errNo
 Thread specific value of errno at time of exit.
 

Private Member Functions

virtual void operator() ()
 Setup the running of the system call.
 
virtual void operator() ()
 Action to perform.
 

Private Attributes

name_type name
 
std::unique_ptr< _p_type_p
 

Detailed Description

Perform a system call within a thread.

This is an abstract class that should be used as the base for a class that is to perform some system call 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
inherited

◆ name_type [2/2]

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

◆ signal_type [1/2]

Data class for passing signal information.

◆ signal_type [2/2]

Data class for passing signal information.

Constructor & Destructor Documentation

◆ SystemCallTask() [1/2]

LDASTools::AL::SystemCallTask::SystemCallTask ( )

Constructor.

Because system calls can be very peristant within a thread context, system calls are set up to background without a reaper to prevent resource starvation for the rest of the code.

◆ SystemCallTask() [2/2]

LDASTools::AL::SystemCallTask::SystemCallTask ( )

Constructor.

Member Function Documentation

◆ Baton() [1/2]

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

Retrieve baton to gain exclusive access.

◆ Baton() [2/2]

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

Retrieve baton to gain exclusive access.

◆ CancelMethod() [1/2]

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

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

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

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

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

◆ delete_on_completion() [2/2]

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

◆ DeleteOnCompletion() [1/2]

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

Retrieve state information concearning deletion.

Returns
True if the task should be deleted once terminated.

◆ DeleteOnCompletion() [2/2]

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

Retrieve state information concearning deletion.

Returns
True if the task should be deleted once terminated.

◆ eval() [1/2]

virtual int LDASTools::AL::SystemCallTask::eval ( )
protectedpure virtual

Action to be performed.

Implemented in Directory::Internals, and LDASTools::AL::Directory::Internals.

◆ eval() [2/2]

virtual int LDASTools::AL::SystemCallTask::eval ( )
protectedpure virtual

Action to be performed.

Implemented in Directory::Internals, and LDASTools::AL::Directory::Internals.

◆ OnCompletion() [1/2]

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

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

Action to be done when task completes.

◆ operator()() [1/2]

void LDASTools::AL::SystemCallTask::operator() ( )
privatevirtual

Setup the running of the system call.

Implements LDASTools::AL::Task.

◆ operator()() [2/2]

virtual void LDASTools::AL::SystemCallTask::operator() ( )
privatevirtual

Action to perform.

Implements LDASTools::AL::Task.

◆ SystemErrNo() [1/2]

int LDASTools::AL::SystemCall::SystemErrNo ( ) const
inlineinherited

Return the thread specific value of errno.

◆ SystemErrNo() [2/2]

int LDASTools::AL::SystemCall::SystemErrNo ( ) const
inherited

Return the thread specific value of errno.

◆ SystemReturnCode() [1/2]

int LDASTools::AL::SystemCall::SystemReturnCode ( ) const
inlineinherited

Return the return code of the system call.

◆ SystemReturnCode() [2/2]

int LDASTools::AL::SystemCall::SystemReturnCode ( ) const
inherited

Return the return code of the system call.

◆ TaskName() [1/2]

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

Get the name of the current task.

◆ TaskName() [2/2]

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

Get the name of the current task.

◆ taskName() [1/2]

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

◆ taskName() [2/2]

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_errNo

int LDASTools::AL::SystemCall::m_errNo
protectedinherited

Thread specific value of errno at time of exit.

This allows for the thread specific errno value to be known outside of the calling thread. It is most benificial for error recovery as some conditions should cause a retry.

◆ m_returnCode

int LDASTools::AL::SystemCall::m_returnCode
protectedinherited

Return code of the system call.

This is the return code returned by the system call as defined by the system call's documentation.

◆ name

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

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