4 #import "keychain/ot/OctagonStateMachineHelpers.h"
5 #import "keychain/ot/OctagonPendingFlag.h"
7 NS_ASSUME_NONNULL_BEGIN
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.
13 @protocol OctagonFlagContainer
14 - (BOOL
)_onqueueContains
:(OctagonFlag
*)flag
;
15 - (NSArray
<NSString
*>*)dumpFlags
;
16 - (CKKSCondition
*)conditionForFlag
:(OctagonFlag
*)flag
;
19 @protocol OctagonFlagSetter
<OctagonFlagContainer
>
20 - (void)setFlag
:(OctagonFlag
*)flag
;
21 - (void)_onqueueSetFlag
:(OctagonFlag
*)flag
;
24 @protocol OctagonFlagClearer
<OctagonFlagSetter
>
25 - (void)_onqueueRemoveFlag
:(OctagonFlag
*)flag
;
28 @interface OctagonFlags
: NSObject
<OctagonFlagContainer
,
32 @property NSMutableDictionary
<OctagonFlag
*, CKKSCondition
*>* flagConditions
;
34 - (instancetype
)initWithQueue
:(dispatch_queue_t
)queue
35 flags
:(NSSet
<OctagonFlag
*>*)possibleFlags
;
37 - (NSString
*)contentsAsString
;