amino::SingleExecutor Class Reference

An executor which executes task immediately in current thread. More...

#include <single_exec.h>

Inheritance diagram for amino::SingleExecutor:

amino::ExecutorService

List of all members.

Public Member Functions

 SingleExecutor ()
virtual ~SingleExecutor ()
void execute (Runnable *task)
 Execute a task with another thread.
auto_ptr< Futuresubmit (Runnable *task)
 Execute a task with one thread from internal thread pool.
virtual void shutdown ()
 Mark the executor as shutdown state, which mean executor will throw an exception when execute(Runnable*) or submit(Runnable *) are called in future.
virtual void halt ()
 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

Protected Member Functions

virtual bool finished ()


Detailed Description

An executor which executes task immediately in current thread.

Constructor & Destructor Documentation

amino::SingleExecutor::SingleExecutor (  )  [inline]

virtual amino::SingleExecutor::~SingleExecutor (  )  [inline, virtual]


Member Function Documentation

void amino::SingleExecutor::execute ( Runnable task  )  [inline]

Execute a task with another thread.

Exceptions:
std::logic_error when the executor is already shutdown.

auto_ptr<Future> amino::SingleExecutor::submit ( Runnable task  )  [inline]

Execute a task with one thread from internal thread pool.

Parameters:
task is a Runnable which can be executed.
Returns:
A future object which can be used to query result of task.
Exceptions:
std::logic_error when the executor is already shutdown.

virtual void amino::SingleExecutor::shutdown (  )  [inline, virtual]

Mark the executor as shutdown state, which mean executor will throw an exception when execute(Runnable*) or submit(Runnable *) are called in future.

Implements amino::ExecutorService.

virtual void amino::SingleExecutor::halt (  )  [inline, 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

Implements amino::ExecutorService.

virtual bool amino::SingleExecutor::finished (  )  [inline, protected, virtual]


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