Convert ::Reference to use a string in creation. This sparks an interesting debate...
[dbsrgits/DBM-Deep.git] / lib / DBM / Deep / Iterator / Index.pm
CommitLineData
065b45be 1package DBM::Deep::Iterator::Index;
2
9c7d9738 3use 5.006_000;
065b45be 4
5use strict;
6use warnings FATAL => 'all';
7
8sub new {
9 my $self = bless $_[1] => $_[0];
10 $self->{curr_index} = 0;
11 return $self;
12}
13
14sub at_end {
15 my $self = shift;
16 return $self->{curr_index} >= $self->{iterator}{engine}->hash_chars;
17}
18
19sub get_next_iterator {
20 my $self = shift;
21
22 my $loc;
23 while ( !$loc ) {
24 return if $self->at_end;
25 $loc = $self->{sector}->get_entry( $self->{curr_index}++ );
26 }
27
28 return $self->{iterator}->get_sector_iterator( $loc );
29}
30
311;
32__END__