-
Notifications
You must be signed in to change notification settings - Fork 4
/
machine.h.motemplate
131 lines (115 loc) · 6.86 KB
/
machine.h.motemplate
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to <$managedObjectClassName$>.h instead.
<$if TemplateVar.modules$>@import CoreData;<$else$>#import <CoreData/CoreData.h><$endif$>
#import <QueryKit/QueryKit.h>
<$if hasCustomSuperentity$><$if hasSuperentity$>#import "<$customSuperentity$>.h"<$else$><$if hasCustomBaseCaseImport$>#import <$baseClassImport$><$else$>#import "<$customSuperentity$>.h"<$endif$><$endif$><$endif$>
<$if hasAdditionalHeaderFile$>
#import "<$additionalHeaderFileName$>"
<$endif$>
<$foreach Relationship noninheritedRelationships do$>@class <$Relationship.destinationEntity.managedObjectClassName$>;
@class <$Relationship.destinationEntity.managedObjectClassName$>Attribute;
<$endforeach do$>
<$foreach Attribute noninheritedAttributes do$>
<$if Attribute.hasTransformableAttributeType$>
<$if Attribute.objectAttributeTransformableProtocols$>
<$foreach Protocol Attribute.objectAttributeTransformableProtocols do$>@protocol <$Protocol$>;
<$endforeach do$>
<$else$>@class <$Attribute.objectAttributeClassName$>;<$endif$><$endif$>
<$endforeach do$>
@interface <$managedObjectClassName$>ID : <$if hasSuperentity$><$customSuperentity$>ID<$else$>NSManagedObjectID<$endif$>
@end
@interface <$managedObjectClassName$>Attribute : QKAttribute
<$foreach Attribute noninheritedAttributes do$>
/// Returns an attribute for the property <$Attribute.name$>.
- (QKAttribute *)<$Attribute.name$>;
<$endforeach do$>
<$foreach Relationship noninheritedRelationships do$>
/// Returns an attribute for the relationship <$Relationship.name$>.
- (<$Relationship.destinationEntity.managedObjectClassName$>Attribute *)<$Relationship.name$>;
<$endforeach do$>
@end
@interface _<$managedObjectClassName$> : <$customSuperentity$>
+ (QKQuerySet *)querySetWithManagedObjectContext:(NSManagedObjectContext *)context;
+ (instancetype)insertInManagedObjectContext:(NSManagedObjectContext *)managedObjectContext;
+ (NSString *)entityName;
+ (NSEntityDescription *)entityInManagedObjectContext:(NSManagedObjectContext *)managedObjectContext;
@property (nonatomic, readonly, strong) <$managedObjectClassName$>ID *objectID;
#pragma mark - Attributes
<$foreach Attribute noninheritedAttributes do$>
/// Returns an attribute for the property <$Attribute.name$>.
+ (QKAttribute *)<$Attribute.name$>;
<$endforeach do$>
<$foreach Relationship noninheritedRelationships do$>
/// Returns an attribute for the relationship <$Relationship.name$>.
+ (<$Relationship.destinationEntity.managedObjectClassName$>Attribute *)<$Relationship.name$>;
<$endforeach do$>
#pragma mark -
<$foreach Attribute noninheritedAttributes do$>
<$if Attribute.hasDefinedAttributeType$>
<$if Attribute.isReadonly$>
@property (nonatomic, strong, readonly) <$Attribute.objectAttributeType$> <$Attribute.name$>;
<$else$>
@property (nonatomic, strong) <$Attribute.objectAttributeType$> <$Attribute.name$>;
<$endif$>
<$if Attribute.hasScalarAttributeType$>
<$if Attribute.isReadonly$>
@property (atomic, readonly) <$Attribute.scalarAttributeType$> <$Attribute.name$>Value;
- (<$Attribute.scalarAttributeType$>)<$Attribute.name$>Value;
<$else$>
@property (atomic) <$Attribute.scalarAttributeType$> <$Attribute.name$>Value;
- (<$Attribute.scalarAttributeType$>)<$Attribute.name$>Value;
- (void)set<$Attribute.name.initialCapitalString$>Value:(<$Attribute.scalarAttributeType$>)value_;
<$endif$>
<$endif$>
//- (BOOL)validate<$Attribute.name.initialCapitalString$>:(id *)value_ error:(NSError **)error_;
<$endif$>
<$endforeach do$>
<$foreach Relationship noninheritedRelationships do$>
<$if Relationship.isToMany$>
@property (nonatomic, strong) <$Relationship.immutableCollectionClassName$> *<$Relationship.name$>;
- (<$Relationship.mutableCollectionClassName$> *)<$Relationship.name$>Set;
<$else$>
@property (nonatomic, strong) <$Relationship.destinationEntity.managedObjectClassName$> *<$Relationship.name$>;
//- (BOOL)validate<$Relationship.name.initialCapitalString$>:(id *)value error:(NSError **)error_;
<$endif$>
<$endforeach do$>
<$foreach FetchRequest prettyFetchRequests do$>
<$if FetchRequest.singleResult$>
+ (id)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext *)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>;
+ (id)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext *)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>error:(NSError **)error_;
<$else$>
+ (NSArray*)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext *)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>;
+ (NSArray*)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext *)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>error:(NSError **)error_;
<$endif$>
<$endforeach do$>
<$foreach FetchedProperty noninheritedFetchedProperties do$>
@property (nonatomic, readonly) NSArray *<$FetchedProperty.name$>;
<$endforeach do$>
<$if TemplateVar.frc$>
#if TARGET_OS_IPHONE
<$foreach Relationship noninheritedRelationships do$>
<$if Relationship.isToMany$>
- (NSFetchedResultsController *)new<$Relationship.name.initialCapitalString$>FetchedResultsControllerWithSortDescriptors:(NSArray *)sortDescriptors;
<$endif$>
<$endforeach do$>
#endif
<$endif$>
@end
<$foreach Relationship noninheritedRelationships do$>
<$if Relationship.isToMany$>
@interface _<$managedObjectClassName$> (<$Relationship.name.initialCapitalString$>CoreDataGeneratedAccessors)
- (void)add<$Relationship.name.initialCapitalString$>:(<$Relationship.immutableCollectionClassName$> *)value;
- (void)remove<$Relationship.name.initialCapitalString$>:(<$Relationship.immutableCollectionClassName$> *)value;
- (void)add<$Relationship.name.initialCapitalString$>Object:(<$Relationship.destinationEntity.managedObjectClassName$> *)value;
- (void)remove<$Relationship.name.initialCapitalString$>Object:(<$Relationship.destinationEntity.managedObjectClassName$> *)value;
<$if Relationship.isOrdered$>
- (void)insertObject:(<$Relationship.destinationEntity.managedObjectClassName$> *)value in<$Relationship.name.initialCapitalString$>AtIndex:(NSUInteger)idx;
- (void)removeObjectFrom<$Relationship.name.initialCapitalString$>AtIndex:(NSUInteger)idx;
- (void)insert<$Relationship.name.initialCapitalString$>:(NSArray *)value atIndexes:(NSIndexSet *)indexes;
- (void)remove<$Relationship.name.initialCapitalString$>AtIndexes:(NSIndexSet *)indexes;
- (void)replaceObjectIn<$Relationship.name.initialCapitalString$>AtIndex:(NSUInteger)idx withObject:(<$Relationship.destinationEntity.managedObjectClassName$> *)value;
- (void)replace<$Relationship.name.initialCapitalString$>AtIndexes:(NSIndexSet *)indexes with<$Relationship.name.initialCapitalString$>:(NSArray *)values;
<$endif$>
@end
<$endif$>
<$endforeach do$>