line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Graphviz::DSL::Edge; |
2
|
7
|
|
|
7
|
|
738
|
use strict; |
|
7
|
|
|
|
|
13
|
|
|
7
|
|
|
|
|
537
|
|
3
|
7
|
|
|
7
|
|
42
|
use warnings; |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
245
|
|
4
|
|
|
|
|
|
|
|
5
|
7
|
|
|
7
|
|
37
|
use parent qw/Graphviz::DSL::Component/; |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
56
|
|
6
|
|
|
|
|
|
|
|
7
|
7
|
|
|
7
|
|
435
|
use Carp (); |
|
7
|
|
|
|
|
23
|
|
|
7
|
|
|
|
|
138
|
|
8
|
7
|
|
|
7
|
|
63
|
use Scalar::Util qw/blessed/; |
|
7
|
|
|
|
|
10
|
|
|
7
|
|
|
|
|
441
|
|
9
|
7
|
|
|
7
|
|
38
|
use Graphviz::DSL::Util qw/parse_id/; |
|
7
|
|
|
|
|
20
|
|
|
7
|
|
|
|
|
3626
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
136
|
|
|
136
|
0
|
2234
|
my ($class, %args) = @_; |
13
|
|
|
|
|
|
|
|
14
|
136
|
|
|
|
|
234
|
for my $key (qw/start end/) { |
15
|
270
|
100
|
|
|
|
628
|
unless (exists $args{$key}) { |
16
|
2
|
|
|
|
|
386
|
Carp::croak("missing mandatory parameter '$key'"); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
268
|
|
|
|
|
491
|
my $param = $args{$key}; |
20
|
268
|
100
|
66
|
|
|
2426
|
unless (blessed $param && $param->isa('Graphviz::DSL::Component')) { |
21
|
2
|
|
|
|
|
301
|
Carp::croak("'$key' parameter should isa 'Graphviz::DSL::Component'"); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
132
|
|
100
|
|
|
488
|
my $attrs = delete $args{attributes} || {}; |
26
|
|
|
|
|
|
|
|
27
|
132
|
|
|
|
|
682
|
my $self = bless { |
28
|
|
|
|
|
|
|
start => $args{start}, |
29
|
|
|
|
|
|
|
end => $args{end}, |
30
|
|
|
|
|
|
|
attributes => $attrs, |
31
|
|
|
|
|
|
|
}, $class; |
32
|
|
|
|
|
|
|
|
33
|
132
|
|
|
|
|
427
|
return $self; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub as_string { |
37
|
20
|
|
|
20
|
0
|
41
|
my ($self, $id_directed) = @_; |
38
|
|
|
|
|
|
|
|
39
|
20
|
100
|
|
|
|
43
|
my $edgeop = $id_directed ? '->' : '--'; |
40
|
20
|
|
|
|
|
42
|
my ($start, $end) = ($self->{start}, $self->{end}); |
41
|
|
|
|
|
|
|
|
42
|
20
|
|
|
|
|
34
|
for my $obj ($start, $end) { |
43
|
40
|
50
|
33
|
|
|
329
|
if (blessed $obj && blessed $obj eq 'Graphviz::DSL::Graph') { |
44
|
0
|
|
|
|
|
0
|
$start->{delayd} = 0; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
20
|
|
|
|
|
65
|
sprintf "%s %s %s", $start->as_string, $edgeop, $end->as_string; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub equal_to { |
52
|
70
|
|
|
70
|
0
|
302
|
my ($self, $edge) = @_; |
53
|
70
|
|
|
|
|
148
|
my ($start, $end) = ($self->{start}, $self->{end}); |
54
|
|
|
|
|
|
|
|
55
|
70
|
|
100
|
|
|
128
|
return $start->equal_to($edge->start) && $end->equal_to($edge->end); |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
# accessor |
59
|
101
|
|
|
101
|
0
|
8111
|
sub start { $_[0]->{start} } |
60
|
47
|
|
|
47
|
0
|
196
|
sub end { $_[0]->{end} } |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |