main
1//
2// Licensed under the terms in License.txt
3//
4// Copyright 2010 Allen Ding. All rights reserved.
5//
6
7#import "KWBlockNode.h"
8
9@implementation KWBlockNode
10
11@synthesize description = _description;
12
13#pragma mark -
14#pragma mark Initializing
15
16- (id)initWithCallSite:(KWCallSite *)aCallSite description:(NSString *)aDescription block:(KWVoidBlock)aBlock{
17 if ((self = [super init])) {
18 callSite = [aCallSite retain];
19 _description = [aDescription copy];
20
21 if (aBlock != nil)
22 block = Block_copy(aBlock);
23 }
24
25 return self;
26}
27
28- (void)dealloc {
29 [callSite release];
30 [description release];
31
32 if (block != nil)
33 Block_release(block);
34
35 [super dealloc];
36}
37
38- (void)performBlock
39{
40 if (block != nil) { block(); }
41}
42
43#pragma mark -
44#pragma mark Getting Call Sites
45
46@synthesize callSite;
47
48#pragma mark -
49#pragma mark Accepting Visitors
50
51@synthesize block;
52
53@end