forked from atomicobject/objection
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathObjection.h
43 lines (35 loc) · 1.29 KB
/
Objection.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
#import <Foundation/Foundation.h>
#import "ObjectionModule.h"
#import "ObjectionInjector.h"
#import "ObjectionInstanceEntry.h"
#import "NSObject+Objection.h"
#import "ObjectionEntry.h"
#import <objc/objc.h>
#import <objc/runtime.h>
extern NSSet* ObjectionBuildDependenciesForClass(Class klass, NSSet *requirements);
#define objection_register(value) \
+ (void)initialize { \
if (self == [value class]) { \
[Objection registerClass:[value class] lifeCycle: ObjectionInstantiationRule_Everytime]; \
} \
}
#define objection_register_singleton(value) \
+ (void)initialize { \
if (self == [value class]) { \
[Objection registerClass:[value class] lifeCycle: ObjectionInstantiationRule_Singleton]; \
} \
}
#define objection_requires(args...) \
+ (NSSet *)objectionRequires { \
NSSet *requirements = [NSSet setWithObjects: args, nil]; \
return ObjectionBuildDependenciesForClass(self, requirements); \
} \
@interface Objection : NSObject {
}
+ (ObjectionInjector *) createInjector:(ObjectionModule *)aModule;
+ (ObjectionInjector *) createInjector;
+ (void) registerClass:(Class)theClass lifeCycle:(ObjectionInstantiationRule)lifeCycle;
+ (void)setGlobalInjector:(ObjectionInjector *)anInjector;
+ (ObjectionInjector *) globalInjector;
+ (void) reset;
@end