ZThread::SynchronousExecutor Class Reference

#include <SynchronousExecutor.h>

Inheritance diagram for ZThread::SynchronousExecutor:

ZThread::Executor ZThread::Cancelable ZThread::Waitable ZThread::NonCopyable List of all members.

Public Member Functions

 SynchronousExecutor ()
 Create a new SynchronousExecutor.
virtual ~SynchronousExecutor ()
 Destroy a SynchronousExecutor.
virtual void interrupt ()
virtual void execute (const Task &task)
virtual void cancel ()
virtual bool isCanceled ()
virtual void wait ()
virtual bool wait (unsigned long timeout)

Detailed Description

Author:
Eric Crahen <http://www.code-foo.com>
Date:
<2003-07-16T22:33:51-0400>
Version:
2.3.0
A SynchronousExecutor is an Executor which runs tasks using the thread that submits the task. It runs tasks serially, one at a time, in the order they were submitted to the executor.

See also:
Executor.


Member Function Documentation

void ZThread::SynchronousExecutor::cancel (  )  [virtual]

See also:
Cancelable::cancel()

Implements ZThread::Cancelable.

void ZThread::SynchronousExecutor::execute ( const Task task  )  [virtual]

Submit a task to this Executor, blocking the calling thread until the task is executed.

Parameters:
task Task to be run by a thread managed by this executor
Precondition:
The Executor should have been canceled prior to this invocation.
Postcondition:
The submitted task will be run at some point in the future by this Executor.
Exceptions:
Cancellation_Exception thrown if the Executor was canceled prior to the invocation of this function.
See also:
Executor::execute(const Task& task)

Implements ZThread::Executor.

void ZThread::SynchronousExecutor::interrupt (  )  [virtual]

This operation is not supported by this executor.

Implements ZThread::Executor.

bool ZThread::SynchronousExecutor::isCanceled (  )  [virtual]

See also:
Cancelable::cancel()

Implements ZThread::Cancelable.

bool ZThread::SynchronousExecutor::wait ( unsigned long  timeout  )  [virtual]

Block the calling thread until all tasks submitted prior to this invocation complete or until the calling thread is interrupted.

Parameters:
timeout - maximum amount of time, in milliseconds, to wait for the currently submitted set of Tasks to complete.
Exceptions:
Interrupted_Exception thrown if the calling thread is interrupted before the set of tasks being wait for can complete.
Returns:
  • true if the set of tasks being wait for complete before timeout milliseconds elapse.
  • false othewise.

Implements ZThread::Waitable.

void ZThread::SynchronousExecutor::wait (  )  [virtual]

Block the calling thread until all tasks submitted prior to this invocation complete.

Exceptions:
Interrupted_Exception thrown if the calling thread is interrupted before the set of tasks being wait for can complete.
See also:
Executor::wait()

Implements ZThread::Waitable.


The documentation for this class was generated from the following files:
Generated on Wed Aug 30 03:27:48 2006 for SWG EMU by  doxygen 1.4.7