line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DBM::Deep::Iterator; |
2
|
|
|
|
|
|
|
|
3
|
51
|
|
|
51
|
|
865
|
use 5.008_004; |
|
51
|
|
|
|
|
508
|
|
4
|
|
|
|
|
|
|
|
5
|
51
|
|
|
51
|
|
313
|
use strict; |
|
51
|
|
|
|
|
89
|
|
|
51
|
|
|
|
|
1292
|
|
6
|
51
|
|
|
51
|
|
268
|
use warnings FATAL => 'all'; |
|
51
|
|
|
|
|
110
|
|
|
51
|
|
|
|
|
9223
|
|
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. 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 |
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
|
|
|
161
|
1
|
344
|
my $class = shift; |
40
|
161
|
|
|
|
|
388
|
my ($args) = @_; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
my $self = bless { |
43
|
|
|
|
|
|
|
engine => $args->{engine}, |
44
|
|
|
|
|
|
|
base_offset => $args->{base_offset}, |
45
|
161
|
|
|
|
|
551
|
}, $class; |
46
|
|
|
|
|
|
|
|
47
|
161
|
|
|
|
|
756
|
Scalar::Util::weaken( $self->{engine} ); |
48
|
|
|
|
|
|
|
|
49
|
161
|
|
|
|
|
563
|
$self->reset; |
50
|
|
|
|
|
|
|
|
51
|
160
|
|
|
|
|
676
|
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
|
|
|
1
|
1
|
46
|
sub reset { die "reset must be implemented in a child class" } |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head2 get_next_key( $obj ) |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=cut |
69
|
|
|
|
|
|
|
|
70
|
1
|
|
|
1
|
1
|
9
|
sub get_next_key { die "get_next_key must be implemented in a child class" } |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
1; |
73
|
|
|
|
|
|
|
__END__ |