DWH_File::ID_Mill - DWH_File::ID_Mill documentation


DWH_File documentation Contained in the DWH_File distribution.

Index


Code Index:

NAME

Top

DWH_File::ID_Mill -

SYNOPSIS

Top

DWH_File::ID_Mill is part of the DWH_File distribution. For user-oriented documentation, see DWH_File documentation (perldoc DWH_File).

DESCRIPTION

Top

COPYRIGHT

Top

AUTHORS

Top

    Jakob Schmidt <schmidt@orqwood.dk>


DWH_File documentation Contained in the DWH_File distribution.

package DWH_File::ID_Mill;

use warnings;
use strict;
use vars qw( @ISA $VERSION );

@ISA = qw(  );
$VERSION = 0.01;

sub new {
    my ( $this, $kernel, $property ) = @_;
    my $class = ref $this || $this;
    my $current = $kernel->fetch_property( $property );
    $current ||= 0;
    my $self = { current => $current,
                 kernel => $kernel,
                 property => $property,
                };
    bless $self, $class;
    return $self;
}

sub next {
    $_[ 0 ]->{ current }++;
    return $_[ 0 ]->{ current };
}

sub save {
    my ( $self ) = @_;
    $self->{ kernel }->store_property( $self->{ property },
				       $self->{ current } );
}

1;

__END__

CVS-log (non-pod)

    $Log: ID_Mill.pm,v $
    Revision 1.2  2002/12/18 21:49:11  schmidt
    uses the brand new kernel properties to store state

    Revision 1.1.1.1  2002/09/27 22:41:49  schmidt
    Imported