-
Notifications
You must be signed in to change notification settings - Fork 2
/
CBOperationStack.h
33 lines (25 loc) · 1002 Bytes
/
CBOperationStack.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//
// CBOperationStack.h
//
// Created by Chris Brauchli on 10/01/12.
// Copyright (c) 2012 Chris Brauchli. All rights reserved.
//
// Some ideas and code copied from Cocotron: http://code.google.com/p/cocotron/
//
#import <Foundation/Foundation.h>
@interface CBOperationStack : NSObject
@property (nonatomic, copy) NSString * name;
@property (readonly) NSArray * operations;
@property (readonly) NSUInteger operationCount;
@property (nonatomic, assign) NSInteger maxConcurrentOperationCount;
@property (assign, getter = isSuspended) BOOL suspended;
- (void)addOperation:(NSOperation *)op;
- (void)addOperationWithBlock:(void (^)(void))block;
- (void)addOperations:(NSArray *)ops waitUntilFinished:(BOOL)wait;
- (void)addOperationAtBottomOfStack:(NSOperation *)op;
- (void)cancelAllOperations;
- (void)waitUntilAllOperationsAreFinished;
// TODO: implement these
//+ (id)currentQueue;
//+ (id)mainQueue;
@end