]>
Commit | Line | Data |
---|---|---|
b54c578e A |
1 | |
2 | #if OCTAGON | |
3 | ||
4 | #import "CKKSProvideKeySetOperation.h" | |
5 | ||
6 | @interface CKKSProvideKeySetOperation () | |
7 | @property (nullable) CKKSCurrentKeySet* keyset; | |
8 | ||
9 | @property (nullable) NSOperation* startDependency; | |
10 | @end | |
11 | ||
12 | @implementation CKKSProvideKeySetOperation | |
13 | @synthesize zoneName = _zoneName; | |
14 | @synthesize keyset = _keyset; | |
15 | ||
16 | - (instancetype)initWithZoneName:(NSString*)zoneName | |
17 | { | |
18 | if((self = [super init])) { | |
19 | _zoneName = zoneName; | |
20 | _keyset = nil; | |
21 | _startDependency = [NSBlockOperation blockOperationWithBlock:^{}]; | |
22 | ||
23 | [self addDependency:_startDependency]; | |
24 | } | |
25 | return self; | |
26 | } | |
27 | ||
28 | - (instancetype)initWithZoneName:(NSString*)zoneName keySet:(CKKSCurrentKeySet*)set | |
29 | { | |
30 | if((self = [super init])) { | |
31 | _zoneName = zoneName; | |
32 | _keyset = set; | |
33 | _startDependency = nil; | |
34 | } | |
35 | return self; | |
36 | } | |
37 | ||
38 | - (void)provideKeySet:(CKKSCurrentKeySet *)keyset | |
39 | { | |
40 | self.keyset = keyset; | |
41 | if(self.startDependency) { | |
42 | [[NSOperationQueue currentQueue] addOperation:self.startDependency]; | |
43 | self.startDependency = nil; | |
44 | } | |
45 | } | |
46 | @end | |
47 | ||
48 | #endif // OCTAGON |