#include <Cancelable.h>
Inheritance diagram for ZThread::Cancelable:
Public Member Functions | |
virtual | ~Cancelable () |
Destroy a Cancelable object. | |
virtual void | cancel ()=0 |
virtual bool | isCanceled ()=0 |
Disabling
A cancel()ed object may not necessarily abort it work immediately. Often, it much more elegant for a cancel()ed object to complete handling whatever responsibilities have been assigned to it, but it will not take on any new responsibility.
Exiting
A cancel()ed should complete its responsibilities as soon as possible. Canceling is not only a request to stop taking on new responsibility, and to complete its current responsibility. Its also a request to complete dealing with its current responsibilities, quickly when possible.
virtual void ZThread::Cancelable::cancel | ( | ) | [pure virtual] |
Canceling a Cancelable object makes a request to disable that object. This entails refusing to take on any new responsibility, and completing its current responsibilities quickly.
Canceling an object more than once has no effect.
Implemented in ZThread::BlockingQueue< T, LockType, StorageType >, ZThread::BoundedQueue< T, LockType, StorageType >, ZThread::ConcurrentExecutor, ZThread::LockedQueue< T, LockType, StorageType >, ZThread::MonitoredQueue< T, LockType, StorageType >, ZThread::PoolExecutor, ZThread::Queue< T >, ZThread::SynchronousExecutor, ZThread::Thread, and ZThread::ThreadedExecutor.
virtual bool ZThread::Cancelable::isCanceled | ( | ) | [pure virtual] |
Determine if a Cancelable object has been canceled.
Implemented in ZThread::BlockingQueue< T, LockType, StorageType >, ZThread::BoundedQueue< T, LockType, StorageType >, ZThread::ConcurrentExecutor, ZThread::LockedQueue< T, LockType, StorageType >, ZThread::MonitoredQueue< T, LockType, StorageType >, ZThread::PoolExecutor, ZThread::SynchronousExecutor, ZThread::Thread, and ZThread::ThreadedExecutor.