︙ | | | ︙ | |
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#import "OFValue.h"
#import "OFMethodSignature.h"
#import "OFString.h"
#import "OFValue_bytes.h"
#import "OFValue_nonretainedObject.h"
#import "OFValue_pointer.h"
#import "OFInvalidFormatException.h"
#import "OFOutOfMemoryException.h"
static struct {
Class isa;
} placeholder;
@interface OFValue_placeholder: OFValue
|
>
<
|
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#import "OFValue.h"
#import "OFMethodSignature.h"
#import "OFString.h"
#import "OFValue_bytes.h"
#import "OFValue_nonretainedObject.h"
#import "OFValue_pointer.h"
#import "OFValue_range.h"
#import "OFOutOfMemoryException.h"
static struct {
Class isa;
} placeholder;
@interface OFValue_placeholder: OFValue
|
︙ | | | ︙ | |
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
}
- (instancetype)initWithNonretainedObject: (id)object
{
return (id)[[OFValue_nonretainedObject alloc]
initWithNonretainedObject: object];
}
@end
@implementation OFValue
+ (void)initialize
{
if (self == [OFValue class])
placeholder.isa = [OFValue_placeholder class];
|
>
>
>
>
>
|
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
}
- (instancetype)initWithNonretainedObject: (id)object
{
return (id)[[OFValue_nonretainedObject alloc]
initWithNonretainedObject: object];
}
- (instancetype)initWithRange: (of_range_t)range
{
return (id)[[OFValue_range alloc] initWithRange: range];
}
@end
@implementation OFValue
+ (void)initialize
{
if (self == [OFValue class])
placeholder.isa = [OFValue_placeholder class];
|
︙ | | | ︙ | |
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
|
return [[[self alloc] initWithPointer: pointer] autorelease];
}
+ (instancetype)valueWithNonretainedObject: (id)object
{
return [[[self alloc] initWithNonretainedObject: object] autorelease];
}
- (instancetype)initWithBytes: (const void *)bytes
objCType: (const char *)objCType
{
OF_INVALID_INIT_METHOD
}
- (instancetype)initWithPointer: (const void *)pointer
{
OF_INVALID_INIT_METHOD
}
- (instancetype)initWithNonretainedObject: (id)object
{
OF_INVALID_INIT_METHOD
}
- (bool)isEqual: (id)object
{
const char *objCType;
size_t size;
|
>
>
>
>
>
>
>
>
>
>
|
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
|
return [[[self alloc] initWithPointer: pointer] autorelease];
}
+ (instancetype)valueWithNonretainedObject: (id)object
{
return [[[self alloc] initWithNonretainedObject: object] autorelease];
}
+ (instancetype)valueWithRange: (of_range_t)range
{
return [[[self alloc] initWithRange: range] autorelease];
}
- (instancetype)initWithBytes: (const void *)bytes
objCType: (const char *)objCType
{
OF_INVALID_INIT_METHOD
}
- (instancetype)initWithPointer: (const void *)pointer
{
OF_INVALID_INIT_METHOD
}
- (instancetype)initWithNonretainedObject: (id)object
{
OF_INVALID_INIT_METHOD
}
- (instancetype)initWithRange: (of_range_t)range
{
OF_INVALID_INIT_METHOD
}
- (bool)isEqual: (id)object
{
const char *objCType;
size_t size;
|
︙ | | | ︙ | |
191
192
193
194
195
196
197
198
199
200
201
202
203
204
|
return ret;
}
- (id)nonretainedObjectValue
{
id ret;
[self getValue: &ret
size: sizeof(ret)];
return ret;
}
|
>
>
>
>
>
>
>
>
>
>
|
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
|
return ret;
}
- (id)nonretainedObjectValue
{
id ret;
[self getValue: &ret
size: sizeof(ret)];
return ret;
}
- (of_range_t)rangeValue
{
of_range_t ret;
[self getValue: &ret
size: sizeof(ret)];
return ret;
}
|
︙ | | | ︙ | |