line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package X10::Macro; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
26
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
452
|
use X10::Event; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
220
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new |
9
|
|
|
|
|
|
|
{ |
10
|
0
|
|
|
0
|
0
|
|
my $type = shift; |
11
|
|
|
|
|
|
|
|
12
|
0
|
|
|
|
|
|
my $self = bless { @_ }, $type; |
13
|
|
|
|
|
|
|
|
14
|
0
|
|
|
|
|
|
return $self; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub run |
19
|
|
|
|
|
|
|
{ |
20
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
21
|
|
|
|
|
|
|
|
22
|
0
|
0
|
|
|
|
|
return undef unless $self->{controller}; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# send a list of events (specified by string) |
25
|
0
|
0
|
|
|
|
|
if (exists $self->{events}) |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
26
|
|
|
|
|
|
|
{ |
27
|
0
|
|
|
|
|
|
$self->{controller}->send( |
28
|
0
|
|
|
|
|
|
map { new X10::Event($_) } @{$self->{events}} |
|
0
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
# send a list of events returned by a perl sub |
32
|
|
|
|
|
|
|
elsif (exists $self->{perleval}) |
33
|
|
|
|
|
|
|
{ |
34
|
0
|
|
|
|
|
|
$self->{controller}->send($self->{perleval}->()); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
# run a perl sub |
37
|
|
|
|
|
|
|
elsif (exists $self->{perlsub}) |
38
|
|
|
|
|
|
|
{ |
39
|
0
|
|
|
|
|
|
$self->{perlsub}->(); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
else |
42
|
|
|
|
|
|
|
{ |
43
|
0
|
|
|
|
|
|
return undef; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
return 1; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub controller |
50
|
|
|
|
|
|
|
{ |
51
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
52
|
|
|
|
|
|
|
|
53
|
0
|
0
|
|
|
|
|
if (@_) |
54
|
|
|
|
|
|
|
{ |
55
|
0
|
|
|
|
|
|
$self->{controller} = shift; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
|
return $self->{controller}; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub description |
62
|
|
|
|
|
|
|
{ |
63
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
64
|
0
|
|
|
|
|
|
return $self->{description}; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
1; |
70
|
|
|
|
|
|
|
|