DWH_File::Cache - DWH_File::Cache documentation


DWH_File documentation Contained in the DWH_File distribution.

Index


Code Index:

NAME

Top

DWH_File::Cache -

SYNOPSIS

Top

DWH_File::Cache 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::Cache;

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

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

sub new {
    my ( $this ) = @_;
    my $class = ref $this || $this;
    my $self = {};
    bless $self, $class;
    return $self;
}

sub encache {
    # weaken if available
    $_[ 0 ]->{ $_[ 1 ]->cache_key } = $_[ 1 ];
    $_[ 1 ]->cache_up;
}

sub decache {
    delete $_[ 0 ]->{ $_[ 1 ]->cache_key };
    $_[ 1 ]->cache_down;
}

sub retrieve {
    if ( exists $_[ 0 ]->{ $_[ 1 ] } ) { return $_[ 0 ]->{ $_[ 1 ] } }
    else { return undef }
}


1;

__END__

CVS-log (non-pod)

    $Log: Cache.pm,v $
    Revision 1.1.1.1  2002/09/27 22:41:49  schmidt
    Imported