Cache::Null::Entry - An entry in the Null implementation of Cache


Cache documentation Contained in the Cache distribution.

Index


Code Index:

NAME

Top

Cache::Null::Entry - An entry in the Null implementation of Cache

SYNOPSIS

Top

  See 'Cache::Entry' for a synopsis.

DESCRIPTION

Top

This module implements a version of Cache::Entry for the Cache::Null variant of Cache. It should not be created or used directly, please see 'Cache::Null' or 'Cache::Entry' instead.

SEE ALSO

Top

Cache::Entry, Cache::Null

AUTHOR

Top

 Chris Leishman <chris@leishman.org>
 Based on work by DeWitt Clinton <dewitt@unto.net>

COPYRIGHT

Top


Cache documentation Contained in the Cache distribution.
package Cache::Null::Entry;

require 5.006;
use strict;
use warnings;
use Cache::IOString;

use base qw(Cache::Entry);
use fields qw();

our $VERSION = '2.04';


sub new {
    my Cache::Null::Entry $self = shift;

    $self = fields::new($self) unless ref $self;
    $self->SUPER::new(@_);

    return $self;
}

sub exists {
    #my Cache::Null::Entry $self = shift;
    return 0;
}

sub set {
    #my Cache::Null::Entry $self = shift;
    return;
}

sub get {
    #my Cache::Null::Entry $self = shift;
    return undef;
}

sub size {
    #my Cache::Null::Entry $self = shift;
    return undef;
}

sub remove {
    #my Cache::Null::Entry $self = shift;
    return;
}

sub expiry {
    #my Cache::Null::Entry $self = shift;
    return undef;
}

sub set_expiry {
    #my Cache::Null::Entry $self = shift;
    return;
}

sub _handle {
    my Cache::Null::Entry $self = shift;
    my ($mode) = @_;

    # return undef unless writing - otherwise return a dummy handle
    return undef unless $mode =~ />|\+/;
    my $data = '';
    return Cache::IOString->new(\$data, $mode);
}

sub validity {
    #my Cache::Null::Entry $self = shift;
    return undef;
}

sub set_validity {
    #my Cache::Null::Entry $self = shift;
    return;
}


1;
__END__