If you can read this text, it means you are not experiencing this website at its best. This website is designed for used with a standards-compliant browser.
Current version: 2.3.2
ZThreads
A platform-independent, multi-threading and synchronization library for C++
Home Documentation Downloads CVS Contact
Cancelable Class Referenceabstract

#include <Cancelable.h>

Inheritance diagram for Cancelable:
Executor Queue< T > Thread ConcurrentExecutor PoolExecutor SynchronousExecutor ThreadedExecutor BlockingQueue< T, LockType, StorageType > BoundedQueue< T, LockType, StorageType > LockedQueue< T, LockType, StorageType > MonitoredQueue< T, LockType, StorageType >

Public Member Functions

virtual ~Cancelable ()
 Destroy a Cancelable object.
 
virtual void cancel ()=0
 
virtual bool isCanceled ()=0
 

Detailed Description

Author
Eric Crahen http://www.code-foo.com
Date
<2003-07-16T09:28:46-0400>
Version
2.3.0

The Cancelable interface defines a common method of adding general disable-and-exit semantics to some object. By cancel()ing a Cancelable object, a request is made to disable that object.

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.

Member Function Documentation

◆ cancel()

virtual void 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.

Postcondition
The Cancelable object will have permanently transitioned to a disabled state; it will now refuse to accept new responsibility.

Implemented in BlockingQueue< T, LockType, StorageType >, BoundedQueue< T, LockType, StorageType >, ConcurrentExecutor, LockedQueue< T, LockType, StorageType >, MonitoredQueue< T, LockType, StorageType >, PoolExecutor, SynchronousExecutor, Thread, ThreadedExecutor, and Queue< T >.

◆ isCanceled()

virtual bool isCanceled ( )
pure virtual

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