line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
=head1 NAME |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
Cache::Null::Entry - An entry in the Null implementation of Cache |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 SYNOPSIS |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
See 'Cache::Entry' for a synopsis. |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 DESCRIPTION |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
This module implements a version of Cache::Entry for the Cache::Null variant |
12
|
|
|
|
|
|
|
of Cache. It should not be created or used directly, please see |
13
|
|
|
|
|
|
|
'Cache::Null' or 'Cache::Entry' instead. |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=cut |
16
|
|
|
|
|
|
|
package Cache::Null::Entry; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
require 5.006; |
19
|
2
|
|
|
2
|
|
8
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
57
|
|
20
|
2
|
|
|
2
|
|
6
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
35
|
|
21
|
2
|
|
|
2
|
|
338
|
use Cache::IOString; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
43
|
|
22
|
|
|
|
|
|
|
|
23
|
2
|
|
|
2
|
|
7
|
use base qw(Cache::Entry); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
581
|
|
24
|
2
|
|
|
2
|
|
10
|
use fields qw(); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
516
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
our $VERSION = '2.11'; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub new { |
30
|
1
|
|
|
1
|
0
|
1
|
my Cache::Null::Entry $self = shift; |
31
|
|
|
|
|
|
|
|
32
|
1
|
50
|
|
|
|
5
|
$self = fields::new($self) unless ref $self; |
33
|
1
|
|
|
|
|
54
|
$self->SUPER::new(@_); |
34
|
|
|
|
|
|
|
|
35
|
1
|
|
|
|
|
2
|
return $self; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub exists { |
39
|
|
|
|
|
|
|
#my Cache::Null::Entry $self = shift; |
40
|
4
|
|
|
4
|
1
|
25
|
return 0; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub set { |
44
|
|
|
|
|
|
|
#my Cache::Null::Entry $self = shift; |
45
|
1
|
|
|
1
|
1
|
1
|
return; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub get { |
49
|
|
|
|
|
|
|
#my Cache::Null::Entry $self = shift; |
50
|
4
|
|
|
4
|
1
|
25
|
return undef; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub size { |
54
|
|
|
|
|
|
|
#my Cache::Null::Entry $self = shift; |
55
|
2
|
|
|
2
|
1
|
18
|
return undef; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub remove { |
59
|
|
|
|
|
|
|
#my Cache::Null::Entry $self = shift; |
60
|
1
|
|
|
1
|
1
|
1
|
return; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub expiry { |
64
|
|
|
|
|
|
|
#my Cache::Null::Entry $self = shift; |
65
|
0
|
|
|
0
|
1
|
0
|
return undef; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub set_expiry { |
69
|
|
|
|
|
|
|
#my Cache::Null::Entry $self = shift; |
70
|
0
|
|
|
0
|
1
|
0
|
return; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub _handle { |
74
|
4
|
|
|
4
|
|
6
|
my Cache::Null::Entry $self = shift; |
75
|
4
|
|
|
|
|
5
|
my ($mode) = @_; |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
# return undef unless writing - otherwise return a dummy handle |
78
|
4
|
100
|
|
|
|
30
|
return undef unless $mode =~ />|\+/; |
79
|
3
|
|
|
|
|
5
|
my $data = ''; |
80
|
3
|
|
|
|
|
25
|
return Cache::IOString->new(\$data, $mode); |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub validity { |
84
|
|
|
|
|
|
|
#my Cache::Null::Entry $self = shift; |
85
|
0
|
|
|
0
|
1
|
|
return undef; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub set_validity { |
89
|
|
|
|
|
|
|
#my Cache::Null::Entry $self = shift; |
90
|
0
|
|
|
0
|
1
|
|
return; |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
1; |
95
|
|
|
|
|
|
|
__END__ |