| 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
| |||||||||||
| 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
| |||||||||||
| 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__ | ||||||||||