-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGCCommand.m
50 lines (43 loc) · 1 KB
/
GCCommand.m
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
/*
* GCCommand.m
* libGlobalCache
*
* Created on 6/28/09.
* Copyright (c) 2009-2013 by NSDex. All rights reserved.
*/
#import "GCCommand.h"
@implementation GCCommand
@synthesize commandType;
@synthesize doNotWait;
@synthesize commandData;
@synthesize pos;
@synthesize irid;
@synthesize senThread;
@synthesize sen;
@synthesize callback;
@synthesize context;
@synthesize response;
@synthesize next;
- (id)initWithCommand:(GCCommandType)c data:(NSData*)data sender:(id)sender callback:(SEL)cb context:(NSObject*)ct {
if(self = [super init]) {
commandData = data; pos = 0;
[commandData retain];
callback = cb;
context = ct;
if(ct != nil) { [context retain]; }
commandType = c;
if(c == GCBLINK) doNotWait = YES; else doNotWait = NO;
response = [[GCResponse alloc] initWithType:c];
senThread = [NSThread currentThread];
sen = sender;
irid = -1;
}
return self;
}
- (void)dealloc {
[commandData release];
[response release];
if(context != nil) { [context release]; }
[super dealloc];
}
@end