API 0.9.5
CPOperation Class Reference

Represents an operation that can be run in an CPOperationQueue. More...

#import <CPOperation.h>

Inheritance diagram for CPOperation:

List of all members.

Instance Methods

(void) - addDependency:
(void) - cancel
(JSObject) - completionFunction
(CPArray- dependencies
(id) - init
(BOOL) - isCancelled
(BOOL) - isConcurrent
(BOOL) - isExecuting
(BOOL) - isFinished
(BOOL) - isReady
(void) - main
(void) - observeValueForKeyPath:ofObject:change:context:
(int) - queuePriority
(void) - removeDependency:
(void) - setCompletionFunction:
(void) - setQueuePriority:
(void) - start
(void) - waitUntilFinished

Instance Variables

CPArray operations

Detailed Description

Represents an operation that can be run in an CPOperationQueue.

It should be subclassed an the subclass should implement its own main method to do the actual work.

Definition at line 2 of file CPOperation.h.


Method Documentation

- (void) addDependency: (CPOperation anOperation

Makes the receiver dependent on the completion of the specified operation.

Parameters:
anOperationthe operation that the receiver should depend on

Definition at line 188 of file CPOperation.j.

- (void) cancel

Advises the operation object that it should stop executing its task.

Definition at line 233 of file CPOperation.j.

- (JSObject) completionFunction

The JS function that should be run after the main method

Returns:
JS function

Definition at line 171 of file CPOperation.j.

- (CPArray) dependencies

The operations that the receiver depends on

Returns:
array of operations

Definition at line 218 of file CPOperation.j.

- (id) init

Reimplemented in CPFunctionOperation, and CPInvocationOperation.

Definition at line 82 of file CPOperation.j.

- (BOOL) isCancelled

Indicates if this operation has been cancelled

Returns:
if this operation has been cancelled

Definition at line 126 of file CPOperation.j.

- (BOOL) isConcurrent

Just added for Cocoa compatibility

Returns:
always false

Definition at line 153 of file CPOperation.j.

- (BOOL) isExecuting

Indicates if this operation is currently executing

Returns:
if this operation is currently executing

Definition at line 135 of file CPOperation.j.

- (BOOL) isFinished

Indicates if this operation has finished running

Returns:
if this operation has finished running

Definition at line 144 of file CPOperation.j.

- (BOOL) isReady

Indicates if this operation is ready to be executed. Takes the "isFinished" state of dependent operations into account

Returns:
if this operation is ready to run

Definition at line 162 of file CPOperation.j.

- (void) main

Reimplemented in CPFunctionOperation, and CPInvocationOperation.

Definition at line 77 of file CPOperation.j.

- (void) observeValueForKeyPath: (CPString keyPath
ofObject: (id)  object
change: (CPDictionary change
context: (void)  context 

Definition at line 259 of file CPOperation.j.

- (int) queuePriority

The priority of the operation when used in an operation queue.

Returns:
the priority

Definition at line 253 of file CPOperation.j.

- (void) removeDependency: (CPOperation anOperation

Removes the receiver’s dependence on the specified operation.

Parameters:
anOperationthe operation that the receiver should no longer depend on

Definition at line 204 of file CPOperation.j.

- (void) setCompletionFunction: (JSObject)  aJavaScriptFunction

Sets the JS function that should be run after the main method

Definition at line 179 of file CPOperation.j.

- (void) setQueuePriority: (int)  priority

Sets the priority of the operation when used in an operation queue.

Parameters:
prioritythe priority

Definition at line 244 of file CPOperation.j.

- (void) start

Starts the operation (runs the main method), sets all the status flags and runs the completion function if it's set

Definition at line 101 of file CPOperation.j.

- (void) waitUntilFinished

Just added for Cocoa compatibility, doesn't do anything

Definition at line 226 of file CPOperation.j.


Instance Variable Documentation

- (CPArray) operations [protected]

Definition at line 4 of file CPOperation.h.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Defines