line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package StateML::State ; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
5220
|
use strict ; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
89
|
|
4
|
3
|
|
|
3
|
|
14
|
use Carp ; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
177
|
|
5
|
3
|
|
|
3
|
|
13
|
use base qw(StateML::Object ) ; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
1474
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 DESCRIPTION |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 METHODS |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
TODO: Complete the docs. |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
See L for methods available to all objects. |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=over |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=cut |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub new { |
20
|
5
|
|
|
5
|
1
|
49
|
return shift()->SUPER::new( |
21
|
|
|
|
|
|
|
ENTRY_HANDLERS => [], |
22
|
|
|
|
|
|
|
EXIT_HANDLERS => [], |
23
|
|
|
|
|
|
|
@_ |
24
|
|
|
|
|
|
|
) ; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub handlers { |
29
|
0
|
|
|
0
|
0
|
0
|
my $self = shift ; |
30
|
0
|
0
|
|
|
|
0
|
$self->{API} = shift if @_ ; |
31
|
0
|
|
|
|
|
0
|
return $self->{API} ; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub number { |
36
|
0
|
|
|
0
|
0
|
0
|
my $self = shift ; |
37
|
0
|
0
|
|
|
|
0
|
confess "Cannot set a state's number." if @_ ; |
38
|
0
|
|
|
|
|
0
|
return $self->{ORDER} ; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub description { |
43
|
0
|
|
|
0
|
0
|
0
|
my $self = shift ; |
44
|
0
|
0
|
|
|
|
0
|
$self->{DESCRIPTION} = shift if @_ ; |
45
|
0
|
|
|
|
|
0
|
return $self->{DESCRIPTION}; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub entry_handlers { |
50
|
0
|
|
|
0
|
0
|
0
|
my $self = shift ; |
51
|
0
|
|
|
|
|
0
|
my $all = $self->machine->state_by_id( "#ALL" ) ; |
52
|
0
|
0
|
|
|
|
0
|
return @{$self->{ENTRY_HANDLERS}}, $all ? @{$all->{ENTRY_HANDLERS}} : () ; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub exit_handlers { |
57
|
0
|
|
|
0
|
0
|
0
|
my $self = shift ; |
58
|
0
|
|
|
|
|
0
|
my $all = $self->machine->state_by_id( "#ALL" ) ; |
59
|
0
|
0
|
|
|
|
0
|
return $all ? @{$all->{EXIT_HANDLERS}} : (), @{$self->{EXIT_HANDLERS}} ; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub _set_number { |
64
|
3
|
|
|
3
|
|
5
|
my $self = shift ; |
65
|
3
|
|
|
|
|
7
|
$self->{ORDER} = shift ; |
66
|
3
|
|
|
|
|
8
|
return ; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=item arcs_from |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Returns a list of arcs out of this state. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
This is a convenience method for template generation. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=cut |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub arcs_from { |
78
|
1
|
|
|
1
|
1
|
250
|
my $self = shift; |
79
|
1
|
|
|
|
|
3
|
my $id = $self->id; |
80
|
1
|
|
|
|
|
8
|
grep $_->from eq $id, $self->machine->arcs; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=item arcs_to |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Returns a list of arcs into this state. |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
This is a convenience method for template generation. |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=cut |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub arcs_to { |
92
|
1
|
|
|
1
|
1
|
171
|
my $self = shift; |
93
|
1
|
|
|
|
|
4
|
my $id = $self->id; |
94
|
1
|
|
|
|
|
5
|
grep $_->to eq $id, $self->machine->arcs; |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=back |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=head1 LIMITATIONS |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head1 COPYRIGHT |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
Copyright 2003, R. Barrie Slaymaker, Jr., All Rights Reserved |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 LICENSE |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
You may use this module under the terms of the BSD, Artistic, or GPL licenses, |
108
|
|
|
|
|
|
|
any version. |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=head1 AUTHOR |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
Barrie Slaymaker |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=cut |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
1 ; |