line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Pixie::ObjectGraph; |
2
|
|
|
|
|
|
|
|
3
|
16
|
|
|
16
|
|
84
|
use strict; |
|
16
|
|
|
|
|
29
|
|
|
16
|
|
|
|
|
3376
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub new { |
6
|
19
|
|
|
19
|
0
|
67
|
my $proto = shift; |
7
|
19
|
|
|
|
|
93
|
return bless {}, $proto; |
8
|
|
|
|
|
|
|
} |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub add_edge { |
11
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
12
|
0
|
|
|
|
|
|
my($source => $dest) = @_; |
13
|
|
|
|
|
|
|
|
14
|
0
|
|
|
|
|
|
push @{$self->{$source}}, $dest; |
|
0
|
|
|
|
|
|
|
15
|
0
|
|
|
|
|
|
return $self; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub neighbours { |
19
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
20
|
0
|
|
|
|
|
|
my $source = shift; |
21
|
0
|
0
|
|
|
|
|
my @retary = exists($self->{$source}) ? @{$self->{$source}} : (); |
|
0
|
|
|
|
|
|
|
22
|
0
|
0
|
|
|
|
|
wantarray ? @retary : [@retary]; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub add_graph { |
26
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
27
|
0
|
|
|
|
|
|
my $other_graph = shift; |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
@{$self}{keys %$other_graph} = values %$other_graph; |
|
0
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
return $self; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |