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.1
ZThreads
A platform-independent, multi-threading and synchronization library for C++
Home Documentation Downloads CVS Contact

# Cancelable Class Reference

`#include <Cancelable.h>`

Inheritance diagram for Cancelable:

List of all members.

## 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

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, BoundedQueue, ConcurrentExecutor, LockedQueue, MonitoredQueue, PoolExecutor, Queue, SynchronousExecutor, Thread, and ThreadedExecutor.

virtual bool isCanceled | ( |  | ) | `[pure virtual]`

| Determine if a Cancelable object has been canceled. Returns: true if cancel() was called prior to this function. false otherwise. Implemented in BlockingQueue, BoundedQueue, ConcurrentExecutor, LockedQueue, MonitoredQueue, PoolExecutor, SynchronousExecutor, Thread, and ThreadedExecutor.

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

- Cancelable.h