-
Notifications
You must be signed in to change notification settings - Fork 1
/
JRTruthTable.h
57 lines (44 loc) · 1.77 KB
/
JRTruthTable.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// JRTruthTable.h semver:0.0.4
// Copyright (c) 2011 Jonathan 'Wolf' Rentzsch: http://rentzsch.com
// Some rights reserved: http://opensource.org/licenses/MIT
// https://github.com/rentzsch/JRTruthTable
#import <Foundation/Foundation.h>
extern NSString * const JRTruthTable_EndOfColumns;
extern NSString * const JRTruthTable_CurrentStateChangedNotification;
extern NSString * const JRTruthTable_CurrentStateChangedNotification_PreviousState;
@class JRTruthTable;
@protocol JRTruthTableConditionSource <NSObject>
@required
- (id)truthTable:(JRTruthTable*)truthTable_ currentValueOfCondition:(NSString*)conditionName_;
@end
@interface JRTruthTable : NSObject {
#ifndef NOIVARS
@protected
NSArray *conditionNames;
NSMutableArray *rows;
NSMutableDictionary *currentConditionsCache;
id<JRTruthTableConditionSource> conditionSource;
#endif
}
@property(assign) id<JRTruthTableConditionSource> conditionSource;
@property(retain, readonly) NSArray *conditionNames;
@property(retain, readonly) id currentState;
- (id)initWithConditionSource:(id<JRTruthTableConditionSource>)conditionSource_ columnsAndRows:(id)firstColumn_, ... NS_REQUIRES_NIL_TERMINATION;
- (void)reload;
- (void)reloadCondition:(NSString*)conditionName_;
- (void)addStateChangeObserver:(id)observer_ selector:(SEL)selector_;
@end
@interface JRTruthTableDictionaryConditionSource : NSObject <JRTruthTableConditionSource> {
#ifndef NOIVARS
@protected
NSDictionary *dictionary;
#endif
}
@property(retain) NSDictionary *dictionary;
@end
#ifndef JRYES
#define JRYES (NSNumber*)kCFBooleanTrue
#define JRNO (NSNumber*)kCFBooleanFalse
#define jrT JRYES
#define jrF JRNO
#endif