DBM::Deep::Iterator - DBM::Deep::Iterator documentation


DBM-Deep documentation Contained in the DBM-Deep distribution.

Index


Code Index:

NAME

Top

DBM::Deep::Iterator

PURPOSE

Top

This is an internal-use-only object for DBM::Deep. It is the iterator for FIRSTKEY() and NEXTKEY().

OVERVIEW

Top

This object

METHODS

Top

new(\%params)

The constructor takes a hashref of params. The hashref is assumed to have the following elements:

* engine (of type DBM::Deep::Engine
* base_offset (the base_offset of the invoking DBM::Deep object)

reset()

This method takes no arguments.

It will reset the iterator so that it will start from the beginning again.

This method returns nothing.

get_next_key( $obj )


DBM-Deep documentation Contained in the DBM-Deep distribution.
package DBM::Deep::Iterator;

use 5.008_004;

use strict;
use warnings FATAL => 'all';

sub new {
    my $class = shift;
    my ($args) = @_;

    my $self = bless {
        engine      => $args->{engine},
        base_offset => $args->{base_offset},
    }, $class;

    Scalar::Util::weaken( $self->{engine} );

    $self->reset;

    return $self;
}

sub reset { die "reset must be implemented in a child class" }

sub get_next_key { die "get_next_key must be implemented in a child class" }

1;
__END__