File: Entry.pm

package info (click to toggle)
libcache-perl 2.11-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 428 kB
  • sloc: perl: 2,577; makefile: 2
file content (116 lines) | stat: -r--r--r-- 2,086 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
=head1 NAME

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

=head1 SYNOPSIS

  See 'Cache::Entry' for a synopsis.

=head1 DESCRIPTION

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.

=cut
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.11';


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__

=head1 SEE ALSO

Cache::Entry, Cache::Null

=head1 AUTHOR

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

=head1 COPYRIGHT

 Copyright (C) 2003-2006 Chris Leishman.  All Rights Reserved.

This module is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
either expressed or implied. This program is free software; you can
redistribute or modify it under the same terms as Perl itself.

$Id: Entry.pm,v 1.5 2006/01/31 15:23:58 caleishm Exp $

=cut