Cache/Memory/HeapElem.pm

filter: Statementstmt 100% 26 / 26 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 66.6% 4 / 6 totaltotal 95.5% 43 / 45 CC 3 SCAR 3.1
CC
3
Cov
100%
val
2.0
heap
2.0
BEGIN
1.0
CRAP 1.4
« Cache/RemovalStrategy.pm ↑ Summary Cache/File.pm »
1 =head1 NAME
2  
3 Cache::Memory::HeapElem - wrapper for Heap::Elem that stores keys
4  
5 =head1 DESCRIPTION
6  
7 For internal use by Cache::Memory only.
8  
9 =cut
10 package Cache::Memory::HeapElem;
11  
12 6 require 5.006;
13 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 6 ▶use Heap::Elem;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 6 our @ISA = qw(Heap::Elem);
17  
18 491 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
19 491 my $class = shift;
20 491 my ($namespace, $key, $value) = @_;
21 491 return bless [ $value, $namespace, $key, undef ], $class;
22 }
23  
24 32 ▶sub val {
Subroutine val: called CC=2 SCAR=6.9
Pod documented
25 32 my $self = shift;
26 32 ▶ return @_ ? ($self->[0] = shift) : $self->[0];
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 22 10 32
27 }
28  
29 9 ▶sub namespace {
Subroutine namespace: called CC=1 SCAR=0.0
Pod undocumented
30 9 my $self = shift;
31 9 return $self->[1];
32 }
33  
34 17 ▶sub key {
Subroutine key: called CC=1 SCAR=0.0
Pod undocumented
35 17 my $self = shift;
36 17 return $self->[2];
37 }
38  
39 1486 ▶sub heap {
Subroutine heap: called CC=2 SCAR=6.9
Pod documented
40 1486 my $self = shift;
41 1486 ▶ return @_ ? ($self->[3] = shift) : $self->[3];
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 1000 486 1486
42 }
43  
44 2546 ▶sub cmp {
Subroutine cmp: called CC=1 SCAR=0.0
Pod documented
45 2546 my $self = shift;
46 2546 my $other = shift;
47 2546 return $self->[0] <=> $other->[0];
48 }
49  
50  
51 6 1;
52 __END__
« Cache/RemovalStrategy.pm ↑ Summary Cache/File.pm »