File Coverage

blib/lib/DBM/Deep/Sector.pm
Criterion Covered Total %
statement 21 22 95.4
branch n/a
condition n/a
subroutine 10 12 83.3
pod 0 7 0.0
total 31 41 75.6


line stmt bran cond sub pod time code
1             package DBM::Deep::Sector;
2              
3 54     54   1094 use 5.008_004;
  54         187  
4              
5 54     54   283 use strict;
  54         113  
  54         1788  
6 54     54   265 use warnings FATAL => 'all';
  54         116  
  54         7307  
7              
8 54     54   337 use Scalar::Util ();
  54         122  
  54         15250  
9              
10             sub new {
11 34838     34838 0 79698 my $self = bless $_[1], $_[0];
12 34838         71433 Scalar::Util::weaken( $self->{engine} );
13 34838         130732 $self->_init;
14 34830         181523 return $self;
15             }
16              
17       0     sub _init {}
18              
19             sub clone {
20 27     27 0 50 my $self = shift;
21 27         84 return ref($self)->new({
22             engine => $self->engine,
23             type => $self->type,
24             data => $self->data,
25             });
26             }
27              
28              
29 258247     258247 0 734931 sub engine { $_[0]{engine} }
30 152412     152412 0 463748 sub offset { $_[0]{offset} }
31 11443     11443 0 37609 sub type { $_[0]{type} }
32 10304     10304 0 48305 sub staleness { $_[0]{staleness} }
33              
34 0     0 0   sub load { die "load must be implemented in a child class" }
35              
36             1;
37             __END__