]> git.saurik.com Git - apple/security.git/blob - OSX/sec/SOSCircle/SecureObjectSync/SOSAccountTransaction.h
Security-58286.41.2.tar.gz
[apple/security.git] / OSX / sec / SOSCircle / SecureObjectSync / SOSAccountTransaction.h
1 //
2 // SOSAccountTransaction.h
3 // sec
4 //
5 //
6 //
7
8 #ifndef SOSAccountTransaction_h
9 #define SOSAccountTransaction_h
10
11 #include <CoreFoundation/CoreFoundation.h>
12 #import <Security/SecureObjectSync/SOSAccountPriv.h>
13 #include <CoreFoundation/CFRuntime.h>
14
15 NS_ASSUME_NONNULL_BEGIN
16
17 @class SOSAccountTransaction;
18
19 @interface SOSAccount (Transaction)
20
21 + (void)performOnAccountQueue:(void (^)(void))action;
22 + (void)performWhileHoldingAccountQueue:(void (^)(void))action;
23
24 - (void) performTransaction: (void (^)(SOSAccountTransaction* txn)) action;
25 - (void) performTransaction_Locked: (void (^)(SOSAccountTransaction* txn)) action;
26
27 @end
28
29 @interface SOSAccountTransaction : NSObject
30
31 + (instancetype) transactionWithAccount: (SOSAccount*) account;
32
33 - (instancetype) init NS_UNAVAILABLE;
34 - (instancetype) initWithAccount: (SOSAccount*) account NS_DESIGNATED_INITIALIZER;
35
36 - (void) finish;
37 - (void) restart;
38
39 - (void) requestSyncWith: (NSString*) peerID;
40 - (void) requestSyncWithPeers: (NSSet<NSString*>*) peerList;
41
42 @property SOSAccount *account;
43
44 @property (readonly) NSString* description;
45
46 @end
47
48 NS_ASSUME_NONNULL_END
49
50 #endif /* SOSAccountTransaction_h */