line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package POOF::Example::Engine; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
9474
|
use strict; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
65
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
41
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
7
|
use base qw(POOF); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1818
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
10
|
|
|
|
|
|
|
# init |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
14
|
|
|
|
|
|
|
# properties |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub Cylinders : Property Public |
17
|
|
|
|
|
|
|
{ |
18
|
|
|
|
|
|
|
{ |
19
|
0
|
|
|
0
|
0
|
0
|
'type' => 'integer', |
20
|
|
|
|
|
|
|
'default' => 0, |
21
|
|
|
|
|
|
|
} |
22
|
1
|
|
|
1
|
|
8
|
} |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
14
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub Displacement : Property Public |
25
|
|
|
|
|
|
|
{ |
26
|
|
|
|
|
|
|
{ |
27
|
0
|
|
|
0
|
0
|
0
|
'type' => 'float', |
28
|
|
|
|
|
|
|
'default' => 0.0, |
29
|
|
|
|
|
|
|
} |
30
|
1
|
|
|
1
|
|
239
|
} |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub state : Property Private |
33
|
|
|
|
|
|
|
{ |
34
|
|
|
|
|
|
|
{ |
35
|
0
|
|
|
0
|
0
|
0
|
'type' => 'boolean', |
36
|
|
|
|
|
|
|
'default' => 0 |
37
|
|
|
|
|
|
|
} |
38
|
1
|
|
|
1
|
|
203
|
} |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
79
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
41
|
|
|
|
|
|
|
# methods |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub StartEngine : Method Public |
44
|
|
|
|
|
|
|
{ |
45
|
0
|
|
|
0
|
0
|
0
|
my $obj = shift; |
46
|
|
|
|
|
|
|
|
47
|
0
|
0
|
|
|
|
0
|
if ($obj->{'state'} == 1) |
48
|
|
|
|
|
|
|
{ |
49
|
0
|
|
|
|
|
0
|
return 0; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
else |
52
|
|
|
|
|
|
|
{ |
53
|
0
|
|
|
|
|
0
|
$obj->{'state'} = 1; |
54
|
0
|
|
|
|
|
0
|
return 1; |
55
|
|
|
|
|
|
|
} |
56
|
1
|
|
|
1
|
|
209
|
} |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
41
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub StopEngine : Method Public |
59
|
|
|
|
|
|
|
{ |
60
|
0
|
|
|
0
|
0
|
0
|
my $obj = shift; |
61
|
|
|
|
|
|
|
|
62
|
0
|
0
|
|
|
|
0
|
if ($obj->{'state'} == 0) |
63
|
|
|
|
|
|
|
{ |
64
|
0
|
|
|
|
|
0
|
return 0; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
else |
67
|
|
|
|
|
|
|
{ |
68
|
0
|
|
|
|
|
0
|
return 1; |
69
|
|
|
|
|
|
|
} |
70
|
1
|
|
|
1
|
|
370
|
} |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub GetState : Method Public |
73
|
|
|
|
|
|
|
{ |
74
|
0
|
|
|
0
|
0
|
|
my $obj = shift; |
75
|
0
|
|
|
|
|
|
return $obj->{'state'}; |
76
|
1
|
|
|
1
|
|
203
|
} |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
1; |
81
|
|
|
|
|
|
|
__END__ |