API  1.0.0
CPOperation Class Reference

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

#import <CPOperation.h>

+ Inheritance diagram for CPOperation:

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 Methods inherited from CPObject
(void) - addObserver:forKeyPath:options:context:
 
(void) - applyChange:toKeyPath:
 
(id) - autorelease
 
(id) - awakeAfterUsingCoder:
 
(void) - awakeFromCib
 
(void) - bind:toObject:withKeyPath:options:
 
(Class) - classForCoder
 
(Class) - classForKeyedArchiver
 
(CPString- className
 
(id) - copy
 
(void) - dealloc
 
(CPString- description
 
(CPDictionary- dictionaryWithValuesForKeys:
 
(void) - didChange:valuesAtIndexes:forKey:
 
(void) - didChangeValueForKey:
 
(void) - didChangeValueForKey:withSetMutation:usingObjects:
 
(void) - doesNotRecognizeSelector:
 
(CPArray) - exposedBindings
 
(id) - forwardingTargetForSelector:
 
(void) - forwardInvocation:
 
(unsigned) - hash
 
(BOOL) - implementsSelector:
 
(CPDictionary- infoForBinding:
 
(BOOL) - isEqual:
 
(BOOL) - isKindOfClass:
 
(BOOL) - isMemberOfClass:
 
(BOOL) - isProxy
 
(IMP) - methodForSelector:
 
(CPMethodSignature) - methodSignatureForSelector:
 
(id) - mutableArrayValueForKey:
 
(id) - mutableArrayValueForKeyPath:
 
(id) - mutableCopy
 
(id) - mutableSetValueForKey:
 
(id) - mutableSetValueForKeyPath:
 
(id) - performSelector:
 
(id) - performSelector:withObject:
 
(void) - performSelector:withObject:afterDelay:
 
(void) - performSelector:withObject:afterDelay:inModes:
 
(id) - performSelector:withObject:withObject:
 
(id) - performSelector:withObjects:
 
(void) - release
 
(void) - removeObserver:forKeyPath:
 
(id) - replacementObjectForArchiver:
 
(id) - replacementObjectForCoder:
 
(id) - replacementObjectForKeyedArchiver:
 
(BOOL) - respondsToSelector:
 
(id) - retain
 
(id) - self
 
(void) - setValue:forKey:
 
(void) - setValue:forKeyPath:
 
(void) - setValue:forUndefinedKey:
 
(void) - setValuesForKeysWithDictionary:
 
(CPString- UID
 
(void) - unbind:
 
(Class) - valueClassForBinding:
 
(id) - valueForKey:
 
(id) - valueForKeyPath:
 
(id) - valueForUndefinedKey:
 
(void) - willChange:valuesAtIndexes:forKey:
 
(void) - willChangeValueForKey:
 
(void) - willChangeValueForKey:withSetMutation:usingObjects:
 

Instance Variables

CPArray operations
 

Additional Inherited Members

- Class Methods inherited from CPObject
(BOOL) + accessInstanceVariablesDirectly
 
(id) + alloc
 
(id) + allocWithCoder:
 
(BOOL) + automaticallyNotifiesObserversForKey:
 
(void) + cancelPreviousPerformRequestsWithTarget:
 
(void) + cancelPreviousPerformRequestsWithTarget:selector:object:
 
(Class) + class
 
(BOOL) + conformsToProtocol:
 
(void) + exposeBinding:
 
(void) + initialize
 
(IMP) + instanceMethodForSelector:
 
(BOOL) + instancesImplementSelector:
 
(BOOL) + instancesRespondToSelector:
 
(BOOL) + isBindingExclusive:
 
(BOOL) + isSubclassOfClass:
 
(CPSet) + keyPathsForValuesAffectingValueForKey:
 
(void) + load
 
(id) + new
 
(void) + object:performSelector:withObject:afterDelay:inModes:
 
(void) + setVersion:
 
(Class) + superclass
 
(int) + version
 

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

◆ addDependency:()

- (void) addDependency: (CPOperation anOperation
implementation

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

Parameters
anOperationthe operation that the receiver should depend on

Definition at line 190 of file CPOperation.j.

◆ cancel()

- (void) cancel
implementation

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

Definition at line 235 of file CPOperation.j.

◆ completionFunction()

- (JSObject) completionFunction
implementation

The JS function that should be run after the main method

Returns
JS function

Definition at line 173 of file CPOperation.j.

◆ dependencies()

- (CPArray) dependencies
implementation

The operations that the receiver depends on

Returns
array of operations

Definition at line 220 of file CPOperation.j.

◆ init()

- (id) init
implementation

Initializes the receiver

Returns
the initialized receiver

Reimplemented from CPObject.

Reimplemented in CPFunctionOperation, and CPInvocationOperation.

Definition at line 83 of file CPOperation.j.

◆ isCancelled()

- (BOOL) isCancelled
implementation

Indicates if this operation has been cancelled

Returns
if this operation has been cancelled

Definition at line 128 of file CPOperation.j.

◆ isConcurrent()

- (BOOL) isConcurrent
implementation

Just added for Cocoa compatibility

Returns
always false

Definition at line 155 of file CPOperation.j.

◆ isExecuting()

- (BOOL) isExecuting
implementation

Indicates if this operation is currently executing

Returns
if this operation is currently executing

Definition at line 137 of file CPOperation.j.

◆ isFinished()

- (BOOL) isFinished
implementation

Indicates if this operation has finished running

Returns
if this operation has finished running

Definition at line 146 of file CPOperation.j.

◆ isReady()

- (BOOL) isReady
implementation

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 164 of file CPOperation.j.

◆ main()

- (void) main
implementation

Reimplemented in CPFunctionOperation, and CPInvocationOperation.

Definition at line 78 of file CPOperation.j.

◆ observeValueForKeyPath:ofObject:change:context:()

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

Definition at line 261 of file CPOperation.j.

◆ queuePriority()

- (int) queuePriority
implementation

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

Returns
the priority

Definition at line 255 of file CPOperation.j.

◆ removeDependency:()

- (void) removeDependency: (CPOperation anOperation
implementation

Removes the receiver’s dependence on the specified operation.

Parameters
anOperationthe operation that the receiver should no longer depend on

Definition at line 206 of file CPOperation.j.

◆ setCompletionFunction:()

- (void) setCompletionFunction: (JSObject)  aJavaScriptFunction
implementation

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

Definition at line 181 of file CPOperation.j.

◆ setQueuePriority:()

- (void) setQueuePriority: (int)  priority
implementation

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

Parameters
prioritythe priority

Definition at line 246 of file CPOperation.j.

◆ start()

- (void) start
implementation

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

Definition at line 102 of file CPOperation.j.

◆ waitUntilFinished()

- (void) waitUntilFinished
implementation

Just added for Cocoa compatibility, doesn't do anything

Definition at line 228 of file CPOperation.j.

Instance Variable Documentation

◆ operations

- (CPArray) operations
protected

Definition at line 4 of file CPOperation.h.


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