line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::WeakMap::Tie; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
48
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
require Tie::Hash; |
7
|
|
|
|
|
|
|
our @ISA = 'Tie::StdHash'; |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
423
|
use Data::WeakMap::Item::Tie; |
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
32
|
|
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
7
|
use Carp 'croak'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
49
|
|
12
|
1
|
|
|
1
|
|
7
|
use Scalar::Util 'weaken'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
714
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub TIEHASH { |
15
|
6
|
|
|
6
|
|
18
|
bless {}, shift; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub STORE { |
19
|
113
|
|
|
113
|
|
7007
|
my ($self, $key, $value) = @_; |
20
|
|
|
|
|
|
|
|
21
|
113
|
50
|
|
|
|
254
|
croak 'key is not a reference,' unless ref $key ne ''; |
22
|
|
|
|
|
|
|
|
23
|
113
|
|
|
|
|
278
|
weaken(my $c = $key); |
24
|
113
|
|
|
|
|
300
|
my $c_tie = tie $c, 'Data::WeakMap::Item::Tie', \$c, $self, $value; |
25
|
|
|
|
|
|
|
|
26
|
113
|
|
|
|
|
457
|
$self->{$key} = $c_tie; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub FETCH { |
30
|
14
|
|
|
14
|
|
2469
|
my ($self, $key) = @_; |
31
|
|
|
|
|
|
|
|
32
|
14
|
100
|
|
|
|
42
|
if (my $c_tie = $self->{$key}) { |
33
|
13
|
|
|
|
|
47
|
return $c_tie->{value}; |
34
|
|
|
|
|
|
|
} else { |
35
|
1
|
|
|
|
|
10
|
return undef; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub FIRSTKEY { |
40
|
12
|
|
|
12
|
|
10336
|
my ($self) = @_; |
41
|
|
|
|
|
|
|
|
42
|
12
|
|
|
|
|
23
|
my $z = keys %$self; |
43
|
|
|
|
|
|
|
|
44
|
12
|
|
|
|
|
23
|
my $self_key = each %$self; |
45
|
|
|
|
|
|
|
|
46
|
12
|
100
|
|
|
|
33
|
return defined $self_key ? ${ $self->{$self_key}{ref_c} } : undef; |
|
11
|
|
|
|
|
43
|
|
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub NEXTKEY { |
50
|
320
|
|
|
320
|
|
506
|
my ($self, $lastkey) = @_; |
51
|
|
|
|
|
|
|
|
52
|
320
|
|
|
|
|
453
|
my $self_key = each %$self; |
53
|
|
|
|
|
|
|
|
54
|
320
|
100
|
|
|
|
574
|
if (! defined $self_key) { |
55
|
10
|
|
|
|
|
35
|
weaken(${ $_->{ref_c} }) foreach values %$self; |
|
319
|
|
|
|
|
550
|
|
56
|
10
|
|
|
|
|
42
|
return undef; |
57
|
|
|
|
|
|
|
} |
58
|
310
|
|
|
|
|
363
|
return ${ $self->{$self_key}{ref_c} }; |
|
310
|
|
|
|
|
642
|
|
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |