blib/lib/DBM/Deep/Iterator.pm

filter: Statementstmt 100% 17 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 3 / 3 totaltotal 100% 26 / 26 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/DBM/Deep/Sector/File/Data.pm ↑ Summary blib/lib/DBM/Deep/Storage.pm »
1 package DBM::Deep::Iterator;
2  
3 55 ▶use 5.008_004;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 55 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 55 ▶use warnings FATAL => 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 =head1 NAME
9  
10 DBM::Deep::Iterator - iterator for FIRSTKEY() and NEXTKEY()
11  
12 =head1 PURPOSE
13  
14 This is an internal-use-only object for L<DBM::Deep>. It is the iterator
15 for FIRSTKEY() and NEXTKEY().
16  
17 =head1 OVERVIEW
18  
19 This object
20  
21 =head1 METHODS
22  
23 =head2 new(\%params)
24  
25 The constructor takes a hashref of params. The hashref is assumed to have the
26 following elements:
27  
28 =over 4
29  
30 =item * engine (of type L<DBM::Deep::Engine>
31  
32 =item * base_offset (the base_offset of the invoking DBM::Deep object)
33  
34 =back
35  
36 =cut
37  
38 sub new {
39 161 ▶ my $class = shift;
Subroutine new: called CC=1 SCAR=0.0
Pod documented
40 161 my ($args) = @_;
41  
42 my $self = bless {
43 engine => $args->{engine},
44 base_offset => $args->{base_offset},
45 161 }, $class;
46  
47 161 Scalar::Util::weaken( $self->{engine} );
48  
49 161 $self->reset;
50  
51 160 return $self;
52 }
53  
54 =head2 reset()
55  
56 This method takes no arguments.
57  
58 It will reset the iterator so that it will start from the beginning again.
59  
60 This method returns nothing.
61  
62 =cut
63  
64 1 ▶sub reset { die "reset must be implemented in a child class" }
Subroutine reset: called CC=1 SCAR=0.0
Pod documented
65  
66 =head2 get_next_key( $obj )
67  
68 =cut
69  
70 1 ▶sub get_next_key { die "get_next_key must be implemented in a child class" }
Subroutine get_next_key: called CC=1 SCAR=0.0
Pod documented
71  
72 55 1;
73 __END__
« blib/lib/DBM/Deep/Sector/File/Data.pm ↑ Summary blib/lib/DBM/Deep/Storage.pm »