TPIE

2362a60
tpie::job Class Referenceabstract

Inherited by tpie::parallel_sort_impl< iterator_type, comp_type, Progress, min_size >::qsort_job.

Public Member Functions

 job ()
 Default constructor. More...
 
virtual ~job ()
 Default destructor. More...
 
virtual void operator() ()=0
 Called by the worker thread. More...
 
void join ()
 Wait for this job and its subjobs to complete. More...
 
bool is_done ()
 Return true if this job and its subjobs are done. More...
 
void enqueue (job *parent=0)
 Add this job to the job pool. More...
 
void run ()
 Run this job. More...
 

Protected Member Functions

virtual void on_done ()
 Called when this job and all subjobs are done. More...
 

Friends

class job_manager
 The job manager needs to invoke run() on us. More...
 

Detailed Description

Definition at line 33 of file job.h.

Constructor & Destructor Documentation

tpie::job::job ( )

Default constructor.

virtual tpie::job::~job ( )
inlinevirtual

Default destructor.

Definition at line 47 of file job.h.

47 {}

Member Function Documentation

void tpie::job::enqueue ( job parent = 0)

Add this job to the job pool.

Parameters
parent(optional) The parent job, or 0 if this is a root job.

Referenced by tpie::parallel_sort_impl< iterator_type, comp_type, Progress, min_size >::qsort_job::operator()(), and tpie::parallel_sort_impl< iterator_type, comp_type, Progress, min_size >::operator()().

bool tpie::job::is_done ( )

Return true if this job and its subjobs are done.

void tpie::job::join ( )

Wait for this job and its subjobs to complete.

Referenced by tpie::parallel_sort_impl< iterator_type, comp_type, Progress, min_size >::operator()().

virtual void tpie::job::on_done ( )
inlineprotectedvirtual

Called when this job and all subjobs are done.

Reimplemented in tpie::parallel_sort_impl< iterator_type, comp_type, Progress, min_size >::qsort_job.

Definition at line 83 of file job.h.

83 {}
virtual void tpie::job::operator() ( )
pure virtual
void tpie::job::run ( )

Run this job.

Invoke operator() and call done().

Friends And Related Function Documentation

friend class job_manager
friend

The job manager needs to invoke run() on us.

Definition at line 107 of file job.h.


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