]> git.saurik.com Git - apple/security.git/blob - keychain/ot/OctagonFlags.h
Security-59306.11.20.tar.gz
[apple/security.git] / keychain / ot / OctagonFlags.h
1
2 #if OCTAGON
3
4 #import "keychain/ot/OctagonStateMachineHelpers.h"
5 #import "keychain/ot/OctagonPendingFlag.h"
6
7 NS_ASSUME_NONNULL_BEGIN
8
9 // OctagonFlags allow you to set binary flags for consumption by the state machine, similar to processor interrupts
10 // This allows the state machine to respond to external inputs or requests that don't need a timeout attached to them.
11 // Setting and removing flags are idempotent.
12
13 @protocol OctagonFlagContainer
14 - (BOOL)_onqueueContains:(OctagonFlag*)flag;
15 - (NSArray<NSString*>*)dumpFlags;
16 @end
17
18 @protocol OctagonFlagSetter <OctagonFlagContainer>
19 - (void)setFlag:(OctagonFlag*)flag;
20 - (void)_onqueueSetFlag:(OctagonFlag*)flag;
21 @end
22
23 @protocol OctagonFlagClearer <OctagonFlagSetter>
24 - (void)_onqueueRemoveFlag:(OctagonFlag*)flag;
25 @end
26
27 @interface OctagonFlags : NSObject <OctagonFlagContainer,
28 OctagonFlagSetter,
29 OctagonFlagClearer>
30 - (instancetype)initWithQueue:(dispatch_queue_t)queue;
31
32 - (NSString*)contentsAsString;
33 @end
34
35 NS_ASSUME_NONNULL_END
36
37 #endif // OCTAGON