amino::ExecutorService Class Reference

This class is intended to be inherited by executors. More...

#include <exec_serv.h>

Inheritance diagram for amino::ExecutorService:

amino::SingleExecutor amino::ThreadPoolExecutor

List of all members.

Public Member Functions

virtual void shutdown ()=0
 call this method to mark executor as shutdown. No further tasks can be accepted by the executor. Tasks already submitted will be executed.
virtual void halt ()=0
 call this method to mark executor as halt. No further tasks can be accepted by the executor. Tasks already submitted but not started will be canceled. TODO: this function shoud return a list of un-started tasks
virtual bool finished ()=0
virtual void waitTermination ()
 Block caller thread until all tasks inside the executor get executed. shutdown() or halt() method must be called before this method.
virtual bool waitTermination (int timeOut)
 Block caller thread until all tasks inside the executor get executed or timeout is reached. Shutdown() or halt() method must be called before this method.

Protected Member Functions

void notify_finish ()

Protected Attributes

volatile bool fShutdown
condition_variable condFinish
recursive_mutex f_mutex_finish


Detailed Description

This class is intended to be inherited by executors.

Member Function Documentation

void amino::ExecutorService::notify_finish (  )  [inline, protected]

virtual void amino::ExecutorService::shutdown (  )  [pure virtual]

call this method to mark executor as shutdown. No further tasks can be accepted by the executor. Tasks already submitted will be executed.

Implemented in amino::SingleExecutor, and amino::ThreadPoolExecutor.

virtual void amino::ExecutorService::halt (  )  [pure virtual]

call this method to mark executor as halt. No further tasks can be accepted by the executor. Tasks already submitted but not started will be canceled. TODO: this function shoud return a list of un-started tasks

Implemented in amino::SingleExecutor, and amino::ThreadPoolExecutor.

virtual bool amino::ExecutorService::finished (  )  [pure virtual]

virtual void amino::ExecutorService::waitTermination (  )  [inline, virtual]

Block caller thread until all tasks inside the executor get executed. shutdown() or halt() method must be called before this method.

Reimplemented in amino::ThreadPoolExecutor.

virtual bool amino::ExecutorService::waitTermination ( int  timeOut  )  [inline, virtual]

Block caller thread until all tasks inside the executor get executed or timeout is reached. Shutdown() or halt() method must be called before this method.

Parameters:
timeOut timeout in millisecond
Returns:
true if executor is terminated. Or false if timeout is reached.

Reimplemented in amino::ThreadPoolExecutor.


Member Data Documentation

volatile bool amino::ExecutorService::fShutdown [protected]


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

Generated on Tue Dec 9 13:39:39 2008 for Amino by  doxygen 1.5.6